1
0

show waiting dialog during transaction broadcast

This commit is contained in:
ThomasV
2012-10-14 08:25:09 +02:00
parent 52211180ed
commit 69e68e9203
2 changed files with 43 additions and 30 deletions

View File

@@ -795,10 +795,19 @@ class Wallet:
return tx
def sendtx(self, tx):
tx_hash = Hash(tx.decode('hex') )[::-1].encode('hex')
self.tx_event.clear()
self.interface.send([('blockchain.transaction.broadcast', [tx])])
# synchronous
h = self.send_tx(tx)
self.tx_event.wait()
self.receive_tx(h)
def send_tx(self, tx):
# asynchronous
self.tx_event.clear()
tx_hash = Hash(tx.decode('hex') )[::-1].encode('hex')
self.interface.send([('blockchain.transaction.broadcast', [tx])])
return tx_hash
def receive_tx(self,tx_hash):
out = self.tx_result
if out != tx_hash:
return False, "error: " + out