commit 9cd4acafccc914a913582cf6aff91d4bc8264ba3
parent 34a4df1114216b57e74a33c8653ef086088e7b47
Author: ThomasV <thomasv@electrum.org>
Date: Thu, 25 Feb 2016 10:55:37 +0100
update broadcast command, with timeout
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/commands.py b/lib/commands.py
@@ -230,10 +230,10 @@ class Commands:
return Transaction(tx).deserialize()
@command('n')
- def broadcast(self, tx):
+ def broadcast(self, tx, timeout=10):
"""Broadcast a transaction to the network. """
t = Transaction(tx)
- return self.network.synchronous_get(('blockchain.transaction.broadcast', [str(t)]))
+ return self.network.broadcast(str(t), timeout)
@command('')
def createmultisig(self, num, pubkeys):
@@ -655,6 +655,7 @@ command_options = {
'account': (None, "--account", "Account"),
'memo': ("-m", "--memo", "Description of the request"),
'expiration': (None, "--expiration", "Time in seconds"),
+ 'timeout': (None, "--timeout", "Timeout in seconds"),
'force': (None, "--force", "Create new address beyong gap limit, if no more address is available."),
'pending': (None, "--pending", "Show only pending requests."),
'expired': (None, "--expired", "Show only expired requests."),