tRevert "Remove early return in create_sweeptxs_for_our_ctx." - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit 6197cfbb3b00f21fb01fd8ef95a849eb63fc9253
DIR parent 3e8080b669306894b572785e2d6ef6226fda7e90
HTML Author: ThomasV <thomasv@electrum.org>
Date: Fri, 30 Aug 2019 17:40:46 +0200
Revert "Remove early return in create_sweeptxs_for_our_ctx."
This reverts commit d0cfb3ae12dca88ed51f23d68cd2b60a0b46b017.
Diffstat:
M electrum/lnsweep.py | 5 +++++
1 file changed, 5 insertions(+), 0 deletions(-)
---
DIR diff --git a/electrum/lnsweep.py b/electrum/lnsweep.py
t@@ -186,6 +186,11 @@ def create_sweeptxs_for_our_ctx(chan: 'Channel', ctx: Transaction, ctn: int,
return
# we have to_local, to_remote.
# other outputs are htlcs
+ # if they are spent, we need to generate the script
+ # so, second-stage htlc sweep should not be returned here
+ if ctn < chan.get_oldest_unrevoked_ctn(LOCAL):
+ _logger.info("we breached.")
+ return {}
txs = {}
# to_local
output_idx = ctx.get_output_idx_from_address(to_local_address)