1
0

Fix #6021: Do not transition channel state to CLOSED if tx is unconfirmed.

This commit is contained in:
ThomasV
2020-03-09 19:00:59 +01:00
parent af457ea2ec
commit fe2b40b83d
3 changed files with 11 additions and 4 deletions

View File

@@ -771,7 +771,13 @@ class LNWallet(LNWorker):
async def update_closed_channel(self, chan, funding_txid, funding_height, closing_txid, closing_height, keep_watching):
if chan.get_state() < channel_states.CLOSED:
chan.set_state(channel_states.CLOSED)
conf = closing_height.conf
if conf > 0:
chan.set_state(channel_states.CLOSED)
else:
# we must not trust the server with unconfirmed transactions
# if the remote force closed, we remain OPEN until the closing tx is confirmed
pass
if chan.get_state() == channel_states.CLOSED and not keep_watching:
chan.set_state(channel_states.REDEEMED)