1
0

lnsweep: sweep_our_ctx was returning redundant objects

This commit is contained in:
ThomasV
2025-02-20 15:34:57 +01:00
parent f9c427124d
commit 0bbdad3efa

View File

@@ -273,7 +273,7 @@ def sweep_our_htlctx(
def sweep_our_ctx( def sweep_our_ctx(
*, chan: 'AbstractChannel', *, chan: 'AbstractChannel',
ctx: Transaction, ctx: Transaction,
actual_htlc_tx: Transaction=None, # if passed, second stage actual_htlc_tx: Transaction=None, # if passed, return second stage htlcs
) -> Dict[str, SweepInfo]: ) -> Dict[str, SweepInfo]:
"""Handle the case where we force-close unilaterally with our latest ctx. """Handle the case where we force-close unilaterally with our latest ctx.
@@ -324,7 +324,7 @@ def sweep_our_ctx(
txs = {} # type: Dict[str, SweepInfo] txs = {} # type: Dict[str, SweepInfo]
# local anchor # local anchor
if chan.has_anchors(): if actual_htlc_tx is None and chan.has_anchors():
if txin := sweep_ctx_anchor(ctx=ctx, multisig_key=our_conf.multisig_key): if txin := sweep_ctx_anchor(ctx=ctx, multisig_key=our_conf.multisig_key):
txs[txin.prevout.to_str()] = SweepInfo( txs[txin.prevout.to_str()] = SweepInfo(
name='local_anchor', name='local_anchor',