@@ -5581,8 +5581,10 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
55815581 if should_broadcast_commitment {
55825582 let ( mut claimables, mut outputs) =
55835583 self . generate_claimable_outpoints_and_watch_outputs ( None ) ;
5584- claimable_outpoints. append ( & mut claimables) ;
5585- watch_outputs. append ( & mut outputs) ;
5584+ if !self . is_manual_broadcast || self . funding_seen_onchain {
5585+ claimable_outpoints. append ( & mut claimables) ;
5586+ watch_outputs. append ( & mut outputs) ;
5587+ }
55865588 }
55875589
55885590 self . block_confirmed ( height, block_hash, txn_matched, watch_outputs, claimable_outpoints, & broadcaster, & fee_estimator, logger)
@@ -5616,13 +5618,18 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
56165618 log_trace ! ( logger, "Processing {} matched transactions for block at height {}." , txn_matched. len( ) , conf_height) ;
56175619 debug_assert ! ( self . best_block. height >= conf_height) ;
56185620
5619- let should_broadcast = self . should_broadcast_holder_commitment_txn ( logger) ;
5620- if let Some ( payment_hash) = should_broadcast {
5621- let reason = ClosureReason :: HTLCsTimedOut { payment_hash : Some ( payment_hash) } ;
5622- let ( mut new_outpoints, mut new_outputs) =
5623- self . generate_claimable_outpoints_and_watch_outputs ( Some ( reason) ) ;
5624- claimable_outpoints. append ( & mut new_outpoints) ;
5625- watch_outputs. append ( & mut new_outputs) ;
5621+ // Only generate claims if we haven't already done so (e.g., in transactions_confirmed).
5622+ if claimable_outpoints. is_empty ( ) {
5623+ let should_broadcast = self . should_broadcast_holder_commitment_txn ( logger) ;
5624+ if let Some ( payment_hash) = should_broadcast {
5625+ let reason = ClosureReason :: HTLCsTimedOut { payment_hash : Some ( payment_hash) } ;
5626+ let ( mut new_outpoints, mut new_outputs) =
5627+ self . generate_claimable_outpoints_and_watch_outputs ( Some ( reason) ) ;
5628+ if !self . is_manual_broadcast || self . funding_seen_onchain {
5629+ claimable_outpoints. append ( & mut new_outpoints) ;
5630+ watch_outputs. append ( & mut new_outputs) ;
5631+ }
5632+ }
56265633 }
56275634
56285635 // Find which on-chain events have reached their confirmation threshold.
0 commit comments