@@ -43,6 +43,7 @@ class SweepInfo(NamedTuple):
4343 txin : PartialTxInput
4444 txout : Optional [PartialTxOutput ] # only for first-stage htlc tx
4545 can_be_batched : bool # todo: this could be more fine-grained
46+ dust_override : bool
4647
4748 def is_anchor (self ):
4849 return self .name in ['local_anchor' , 'remote_anchor' ]
@@ -260,6 +261,7 @@ def justice_txin(output_idx):
260261 txin = txin ,
261262 txout = None ,
262263 can_be_batched = False ,
264+ dust_override = False ,
263265 )
264266 return index_to_sweepinfo
265267
@@ -337,6 +339,7 @@ def sweep_our_ctx(
337339 txin = txin ,
338340 txout = None ,
339341 can_be_batched = True ,
342+ dust_override = True ,
340343 )
341344
342345 # to_local
@@ -358,6 +361,7 @@ def sweep_our_ctx(
358361 txin = txin ,
359362 txout = None ,
360363 can_be_batched = True ,
364+ dust_override = False ,
361365 )
362366 we_breached = ctn < chan .get_oldest_unrevoked_ctn (LOCAL )
363367 if we_breached :
@@ -398,6 +402,7 @@ def txs_htlc(
398402 # - in particular, it would be safe to batch htlcs where
399403 # htlc_direction, htlc.payment_hash, htlc.cltv_abs
400404 # all match. That is, MPP htlcs for the same payment.
405+ dust_override = False ,
401406 )
402407 else :
403408 # second-stage
@@ -420,6 +425,7 @@ def txs_htlc(
420425 # this is safe to batch, we are the only ones who can spend
421426 # (assuming we did not broadcast a revoked state)
422427 can_be_batched = True ,
428+ dust_override = False ,
423429 )
424430
425431 # offered HTLCs, in our ctx --> "timeout"
@@ -557,6 +563,7 @@ def sweep_their_ctx_to_remote_backup(
557563 txin = txin ,
558564 txout = None ,
559565 can_be_batched = True ,
566+ dust_override = True ,
560567 )
561568
562569 # to_remote
@@ -577,6 +584,7 @@ def sweep_their_ctx_to_remote_backup(
577584 txin = txin ,
578585 txout = None ,
579586 can_be_batched = True ,
587+ dust_override = False ,
580588 )
581589 return txs
582590
@@ -634,6 +642,7 @@ def sweep_their_ctx(
634642 txin = txin ,
635643 txout = None ,
636644 can_be_batched = True ,
645+ dust_override = True ,
637646 )
638647
639648 # to_local is handled by lnwatcher
@@ -646,6 +655,7 @@ def sweep_their_ctx(
646655 txin = txin ,
647656 txout = None ,
648657 can_be_batched = False ,
658+ dust_override = False ,
649659 )
650660
651661 # to_remote
@@ -676,6 +686,7 @@ def sweep_their_ctx(
676686 txin = txin ,
677687 txout = None ,
678688 can_be_batched = True ,
689+ dust_override = False ,
679690 )
680691
681692 # HTLCs
@@ -715,6 +726,7 @@ def tx_htlc(
715726 txout = None ,
716727 can_be_batched = False , # both parties can spend
717728 # (still, in some cases we could batch, see comment in sweep_our_ctx)
729+ dust_override = False ,
718730 )
719731 # received HTLCs, in their ctx --> "timeout"
720732 # offered HTLCs, in their ctx --> "success"
0 commit comments