mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
qt: add menu item to view closing transaction of channel
This commit is contained in:
parent
b12c913d47
commit
7771daf94e
2 changed files with 10 additions and 0 deletions
|
@ -119,6 +119,11 @@ class ChannelsList(MyTreeView):
|
||||||
if chan.peer_state == peer_states.GOOD:
|
if chan.peer_state == peer_states.GOOD:
|
||||||
menu.addAction(_("Close channel"), lambda: self.close_channel(channel_id))
|
menu.addAction(_("Close channel"), lambda: self.close_channel(channel_id))
|
||||||
menu.addAction(_("Force-close channel"), lambda: self.force_close(channel_id))
|
menu.addAction(_("Force-close channel"), lambda: self.force_close(channel_id))
|
||||||
|
else:
|
||||||
|
txid = chan.get_closing_txid()
|
||||||
|
closing_tx = self.lnworker.lnwatcher.db.get_transaction(txid)
|
||||||
|
if closing_tx:
|
||||||
|
menu.addAction(_("View closing transaction"), lambda: self.parent.show_transaction(closing_tx))
|
||||||
if chan.is_redeemed():
|
if chan.is_redeemed():
|
||||||
menu.addAction(_("Remove"), lambda: self.remove_channel(channel_id))
|
menu.addAction(_("Remove"), lambda: self.remove_channel(channel_id))
|
||||||
menu.exec_(self.viewport().mapToGlobal(position))
|
menu.exec_(self.viewport().mapToGlobal(position))
|
||||||
|
|
|
@ -311,6 +311,11 @@ class Channel(Logger):
|
||||||
# the closing txid has been saved
|
# the closing txid has been saved
|
||||||
return self.get_state() >= channel_states.CLOSED
|
return self.get_state() >= channel_states.CLOSED
|
||||||
|
|
||||||
|
def get_closing_txid(self):
|
||||||
|
item = self.lnworker.channel_timestamps.get(self.channel_id.hex())
|
||||||
|
funding_txid, funding_height, funding_timestamp, closing_txid, closing_height, closing_timestamp = item
|
||||||
|
return closing_txid
|
||||||
|
|
||||||
def is_redeemed(self):
|
def is_redeemed(self):
|
||||||
return self.get_state() == channel_states.REDEEMED
|
return self.get_state() == channel_states.REDEEMED
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue