Skip to content

Commit e86198d

Browse files
committed
lnpeer: fix possibly nonexistant to_remote
Fixes a regression introduced by 947693c.
1 parent 456a921 commit e86198d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

electrum/lnpeer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,8 +1846,9 @@ def verify_signature(tx, sig):
18461846
raise Exception('failed to verify their signature')
18471847
# at this point we know how the closing tx looks like
18481848
# check that their output is above their scriptpubkey's network dust limit
1849-
if not drop_to_remote:
1850-
to_remote_idx = closing_tx.get_output_idxs_from_scriptpubkey(their_scriptpubkey.hex()).pop()
1849+
to_remote_set = closing_tx.get_output_idxs_from_scriptpubkey(their_scriptpubkey.hex())
1850+
if not drop_to_remote and to_remote_set:
1851+
to_remote_idx = to_remote_set.pop()
18511852
to_remote_amount = closing_tx.outputs()[to_remote_idx].value
18521853
transaction.check_scriptpubkey_template_and_dust(their_scriptpubkey, to_remote_amount)
18531854

0 commit comments

Comments
 (0)