URI: 
       tdo not co-op close channels with pending htlcs - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 8a98810df15a78ef5d78ea3c4ea7a69a1bb98c19
   DIR parent 9cf7aa054d24b84c023fda1ed87a27dcb2b2a4e6
  HTML Author: Janus <ysangkok@gmail.com>
       Date:   Mon,  5 Nov 2018 18:48:00 +0100
       
       do not co-op close channels with pending htlcs
       
       Diffstat:
         M electrum/lnbase.py                  |       2 ++
       
       1 file changed, 2 insertions(+), 0 deletions(-)
       ---
   DIR diff --git a/electrum/lnbase.py b/electrum/lnbase.py
       t@@ -1152,6 +1152,8 @@ class Peer(PrintError):
            @log_exceptions
            async def close_channel(self, chan_id: bytes):
                chan = self.channels[chan_id]
       +        if len(chan.htlcs(LOCAL, only_pending=True)) > 0:
       +            raise Exception('Can\'t co-operatively close channel with payments ongoing (pending HTLCs). Please wait, or force-close the channel.')
                self.shutdown_received[chan_id] = asyncio.Future()
                self.send_shutdown(chan)
                payload = await self.shutdown_received[chan_id]