qt channel details: maybe fix #5728
This commit is contained in:
@@ -46,7 +46,11 @@ class ChannelDetailsDialog(QtWidgets.QDialog):
|
||||
model = QtGui.QStandardItemModel(0, 2)
|
||||
model.setHorizontalHeaderLabels(['HTLC', 'Property value'])
|
||||
parentItem = model.invisibleRootItem()
|
||||
folder_types = {'settled': _('Fulfilled HTLCs'), 'inflight': _('HTLCs in current commitment transaction'), 'failed': _('Failed HTLCs')}
|
||||
folder_types = {
|
||||
'settled': _('Fulfilled HTLCs'),
|
||||
'inflight': _('HTLCs in current commitment transaction'),
|
||||
'failed': _('Failed HTLCs'),
|
||||
}
|
||||
self.folders = {}
|
||||
self.keyname_rows = {}
|
||||
|
||||
@@ -80,7 +84,7 @@ class ChannelDetailsDialog(QtWidgets.QDialog):
|
||||
|
||||
ln_payment_completed = QtCore.pyqtSignal(str, bytes, bytes)
|
||||
ln_payment_failed = QtCore.pyqtSignal(str, bytes, bytes)
|
||||
htlc_added = QtCore.pyqtSignal(str, UpdateAddHtlc, LnAddr, Direction)
|
||||
htlc_added = QtCore.pyqtSignal(str, Channel, UpdateAddHtlc, Direction)
|
||||
state_changed = QtCore.pyqtSignal(str, Abstract_Wallet, AbstractChannel)
|
||||
|
||||
@QtCore.pyqtSlot(str, Abstract_Wallet, AbstractChannel)
|
||||
@@ -90,8 +94,10 @@ class ChannelDetailsDialog(QtWidgets.QDialog):
|
||||
if chan == self.chan:
|
||||
self.update()
|
||||
|
||||
@QtCore.pyqtSlot(str, UpdateAddHtlc, LnAddr, Direction)
|
||||
def do_htlc_added(self, evtname, htlc, lnaddr, direction):
|
||||
@QtCore.pyqtSlot(str, Channel, UpdateAddHtlc, Direction)
|
||||
def do_htlc_added(self, evtname, chan, htlc, direction):
|
||||
if chan != self.chan:
|
||||
return
|
||||
mapping = self.keyname_rows['inflight']
|
||||
mapping[htlc.payment_hash] = len(mapping)
|
||||
self.folders['inflight'].appendRow(self.make_htlc_item(htlc, direction))
|
||||
@@ -151,6 +157,7 @@ class ChannelDetailsDialog(QtWidgets.QDialog):
|
||||
vbox.addWidget(QLabel(_('Remote Node ID:')))
|
||||
remote_id_e = ButtonsLineEdit(bh2u(chan.node_id))
|
||||
remote_id_e.addCopyButton(self.window.app)
|
||||
remote_id_e.setReadOnly(True)
|
||||
vbox.addWidget(remote_id_e)
|
||||
funding_label_text = f'<a href=click_destination>{chan.funding_outpoint.txid}</a>:{chan.funding_outpoint.output_index}'
|
||||
vbox.addWidget(QLabel(_('Funding Outpoint:')))
|
||||
|
||||
@@ -1181,6 +1181,7 @@ class Peer(Logger):
|
||||
timestamp=int(time.time()),
|
||||
htlc_id=htlc_id)
|
||||
chan.receive_htlc(htlc, onion_packet)
|
||||
util.trigger_callback('htlc_added', chan, htlc, RECEIVED)
|
||||
|
||||
def maybe_forward_htlc(self, chan: Channel, htlc: UpdateAddHtlc, *,
|
||||
onion_packet: OnionPacket, processed_onion: ProcessedOnionPacket
|
||||
|
||||
@@ -888,7 +888,7 @@ class LNWallet(LNWorker):
|
||||
payment_hash=lnaddr.paymenthash,
|
||||
min_final_cltv_expiry=lnaddr.get_min_final_cltv_expiry(),
|
||||
payment_secret=lnaddr.payment_secret)
|
||||
util.trigger_callback('htlc_added', htlc, lnaddr, SENT)
|
||||
util.trigger_callback('htlc_added', chan, htlc, SENT)
|
||||
payment_attempt = await self.await_payment(lnaddr.paymenthash)
|
||||
if payment_attempt.success:
|
||||
failure_log = None
|
||||
|
||||
Reference in New Issue
Block a user