mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 01:11:35 +00:00
do not co-op close channels with pending htlcs
This commit is contained in:
parent
481b6c231a
commit
06f24fd11a
1 changed files with 2 additions and 0 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue