URI: 
       tqt: add menu item to view closing transaction of channel - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 7771daf94e47ffa7f06bfb39cd37c012a475b39d
   DIR parent b12c913d47054639486eb58e295ea6ea7f5116e4
  HTML Author: ThomasV <thomasv@electrum.org>
       Date:   Sat, 22 Feb 2020 12:28:07 +0100
       
       qt: add menu item to view closing transaction of channel
       
       Diffstat:
         M electrum/gui/qt/channels_list.py    |       5 +++++
         M electrum/lnchannel.py               |       5 +++++
       
       2 files changed, 10 insertions(+), 0 deletions(-)
       ---
   DIR diff --git a/electrum/gui/qt/channels_list.py b/electrum/gui/qt/channels_list.py
       t@@ -119,6 +119,11 @@ class ChannelsList(MyTreeView):
                    if chan.peer_state == peer_states.GOOD:
                        menu.addAction(_("Close channel"), lambda: self.close_channel(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():
                    menu.addAction(_("Remove"), lambda: self.remove_channel(channel_id))
                menu.exec_(self.viewport().mapToGlobal(position))
   DIR diff --git a/electrum/lnchannel.py b/electrum/lnchannel.py
       t@@ -311,6 +311,11 @@ class Channel(Logger):
                # the closing txid has been saved
                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):
                return self.get_state() == channel_states.REDEEMED