synchronous_get: return -> raise exception
This commit is contained in:
parent
85d9b8aa8d
commit
c844d22a19
|
@ -2272,13 +2272,13 @@ class ElectrumWindow(QMainWindow):
|
||||||
from electrum import transaction
|
from electrum import transaction
|
||||||
txid, ok = QInputDialog.getText(self, _('Lookup transaction'), _('Transaction ID') + ':')
|
txid, ok = QInputDialog.getText(self, _('Lookup transaction'), _('Transaction ID') + ':')
|
||||||
if ok and txid:
|
if ok and txid:
|
||||||
r = self.network.synchronous_get([ ('blockchain.transaction.get',[str(txid)]) ])[0]
|
try:
|
||||||
if r:
|
r = self.network.synchronous_get([('blockchain.transaction.get',[str(txid)])])[0]
|
||||||
tx = transaction.Transaction(r)
|
except BaseException as e:
|
||||||
if tx:
|
self.show_message(str(e))
|
||||||
self.show_transaction(tx)
|
return
|
||||||
else:
|
tx = transaction.Transaction(r)
|
||||||
self.show_message("unknown transaction")
|
self.show_transaction(tx)
|
||||||
|
|
||||||
|
|
||||||
@protected
|
@protected
|
||||||
|
|
|
@ -170,7 +170,7 @@ class NetworkProxy(util.DaemonThread):
|
||||||
_id = r.get('id')
|
_id = r.get('id')
|
||||||
ids.remove(_id)
|
ids.remove(_id)
|
||||||
if r.get('error'):
|
if r.get('error'):
|
||||||
return BaseException(r.get('error'))
|
raise BaseException(r.get('error'))
|
||||||
result = r.get('result')
|
result = r.get('result')
|
||||||
res[_id] = r.get('result')
|
res[_id] = r.get('result')
|
||||||
out = []
|
out = []
|
||||||
|
|
Loading…
Reference in New Issue