|
@ -62,7 +62,7 @@ class QEWallet(AuthMixin, QObject, QtEventListener): |
|
|
paymentFailed = pyqtSignal([str,str], arguments=['key','reason']) |
|
|
paymentFailed = pyqtSignal([str,str], arguments=['key','reason']) |
|
|
requestNewPassword = pyqtSignal() |
|
|
requestNewPassword = pyqtSignal() |
|
|
transactionSigned = pyqtSignal([str], arguments=['txid']) |
|
|
transactionSigned = pyqtSignal([str], arguments=['txid']) |
|
|
#broadcastSucceeded = pyqtSignal([str], arguments=['txid']) |
|
|
broadcastSucceeded = pyqtSignal([str], arguments=['txid']) |
|
|
broadcastFailed = pyqtSignal([str,str,str], arguments=['txid','code','reason']) |
|
|
broadcastFailed = pyqtSignal([str,str,str], arguments=['txid','code','reason']) |
|
|
labelsUpdated = pyqtSignal() |
|
|
labelsUpdated = pyqtSignal() |
|
|
otpRequested = pyqtSignal() |
|
|
otpRequested = pyqtSignal() |
|
@ -476,21 +476,25 @@ class QEWallet(AuthMixin, QObject, QtEventListener): |
|
|
def broadcast(self, tx): |
|
|
def broadcast(self, tx): |
|
|
assert tx.is_complete() |
|
|
assert tx.is_complete() |
|
|
|
|
|
|
|
|
self.network = self.wallet.network # TODO not always defined? |
|
|
network = self.wallet.network # TODO not always defined? |
|
|
|
|
|
|
|
|
try: |
|
|
def broadcast_thread(): |
|
|
self._logger.info('running broadcast in thread') |
|
|
try: |
|
|
self.network.run_from_another_thread(self.network.broadcast_transaction(tx)) |
|
|
self._logger.info('running broadcast in thread') |
|
|
self._logger.info('broadcast submit done') |
|
|
result = network.run_from_another_thread(network.broadcast_transaction(tx)) |
|
|
except TxBroadcastError as e: |
|
|
self._logger.info(repr(result)) |
|
|
self.broadcastFailed.emit(tx.txid(),'',repr(e)) |
|
|
except TxBroadcastError as e: |
|
|
self._logger.error(e) |
|
|
self._logger.error(repr(e)) |
|
|
except BestEffortRequestFailed as e: |
|
|
self.broadcastFailed.emit(tx.txid(),'',repr(e)) |
|
|
self.broadcastFailed.emit(tx.txid(),'',repr(e)) |
|
|
except BestEffortRequestFailed as e: |
|
|
self._logger.error(e) |
|
|
self._logger.error(repr(e)) |
|
|
|
|
|
self.broadcastFailed.emit(tx.txid(),'',repr(e)) |
|
|
|
|
|
else: |
|
|
|
|
|
self.broadcastSucceeded.emit(tx.txid()) |
|
|
|
|
|
|
|
|
|
|
|
threading.Thread(target=broadcast_thread).start() |
|
|
|
|
|
|
|
|
#TODO: properly catch server side errors, e.g. bad-txns-inputs-missingorspent |
|
|
#TODO: properly catch server side errors, e.g. bad-txns-inputs-missingorspent |
|
|
#might need callback from network.py |
|
|
|
|
|
|
|
|
|
|
|
paymentAuthRejected = pyqtSignal() |
|
|
paymentAuthRejected = pyqtSignal() |
|
|
def ln_auth_rejected(self): |
|
|
def ln_auth_rejected(self): |
|
|