mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 01:11:35 +00:00
Qt gui: show messages about payment outcome
This commit is contained in:
parent
02c39a950f
commit
d6b4268fde
2 changed files with 9 additions and 2 deletions
|
@ -223,7 +223,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
|||
interests = ['wallet_updated', 'network_updated', 'blockchain_updated',
|
||||
'new_transaction', 'status',
|
||||
'banner', 'verified', 'fee', 'fee_histogram', 'on_quotes',
|
||||
'on_history', 'channel', 'channels', 'ln_status']
|
||||
'on_history', 'channel', 'channels', 'ln_status', 'ln_message']
|
||||
# To avoid leaking references to "self" that prevent the
|
||||
# window from being GC-ed when closed, callbacks should be
|
||||
# methods of this class only, and specifically not be
|
||||
|
@ -360,7 +360,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
|||
wallet, tx = args
|
||||
if wallet == self.wallet:
|
||||
self.tx_notification_queue.put(tx)
|
||||
elif event in ['status', 'banner', 'verified', 'fee', 'fee_histogram']:
|
||||
elif event in ['status', 'banner', 'verified', 'fee', 'fee_histogram', 'ln_message']:
|
||||
# Handle in GUI thread
|
||||
self.network_signal.emit(event, args)
|
||||
elif event == 'on_quotes':
|
||||
|
@ -395,6 +395,10 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
|||
self.fee_slider.update()
|
||||
self.require_fee_update = True
|
||||
self.history_model.on_fee_histogram()
|
||||
elif event == 'ln_message':
|
||||
lnworker, message = args
|
||||
if lnworker == self.wallet.lnworker:
|
||||
self.show_message(message)
|
||||
else:
|
||||
self.logger.info(f"unexpected network_qt signal: {event} {args}")
|
||||
|
||||
|
|
|
@ -870,6 +870,7 @@ class Peer(PrintError):
|
|||
self.send_commitment(chan) # htlc will be removed
|
||||
await self.receive_revoke(chan)
|
||||
self.lnworker.save_channel(chan)
|
||||
self.network.trigger_callback('ln_message', self.lnworker, 'Payment failed')
|
||||
|
||||
async def _handle_error_code_from_failed_htlc(self, error_reason, route: List[RouteEdge], channel_id, htlc_id):
|
||||
chan = self.channels[channel_id]
|
||||
|
@ -985,6 +986,7 @@ class Peer(PrintError):
|
|||
self.send_commitment(chan) # htlc will be removed
|
||||
await self.receive_revoke(chan)
|
||||
self.lnworker.save_channel(chan)
|
||||
self.network.trigger_callback('ln_message', self.lnworker, 'Payment sent')
|
||||
|
||||
# used in lightning-integration
|
||||
self.payment_preimages[sha256(preimage)].put_nowait(preimage)
|
||||
|
@ -1018,6 +1020,7 @@ class Peer(PrintError):
|
|||
chan.settle_htlc(preimage, htlc_id)
|
||||
await self.update_channel(chan, "update_fulfill_htlc", channel_id=channel_id, id=htlc_id, payment_preimage=preimage)
|
||||
self.lnworker.save_channel(chan)
|
||||
self.network.trigger_callback('ln_message', self.lnworker, 'Payment received')
|
||||
|
||||
def on_revoke_and_ack(self, payload):
|
||||
print("got revoke_and_ack")
|
||||
|
|
Loading…
Add table
Reference in a new issue