@@ -3985,7 +3985,13 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
39853985 }
39863986 claimable_outpoints. append ( & mut new_outpoints) ;
39873987 }
3988- ( claimable_outpoints, watch_outputs)
3988+ // In manual-broadcast mode, if we have not yet observed the funding transaction on-chain,
3989+ // return empty vectors.
3990+ if self . is_manual_broadcast && !self . funding_seen_onchain {
3991+ return ( Vec :: new ( ) , Vec :: new ( ) ) ;
3992+ } else {
3993+ ( claimable_outpoints, watch_outputs)
3994+ }
39893995 }
39903996
39913997 #[ rustfmt:: skip]
@@ -5605,10 +5611,8 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
56055611 if should_broadcast_commitment {
56065612 let ( mut claimables, mut outputs) =
56075613 self . generate_claimable_outpoints_and_watch_outputs ( None ) ;
5608- if !self . is_manual_broadcast || self . funding_seen_onchain {
5609- claimable_outpoints. append ( & mut claimables) ;
5610- watch_outputs. append ( & mut outputs) ;
5611- }
5614+ claimable_outpoints. append ( & mut claimables) ;
5615+ watch_outputs. append ( & mut outputs) ;
56125616 }
56135617
56145618 self . block_confirmed ( height, block_hash, txn_matched, watch_outputs, claimable_outpoints, & broadcaster, & fee_estimator, logger)
@@ -5649,10 +5653,8 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
56495653 let reason = ClosureReason :: HTLCsTimedOut { payment_hash : Some ( payment_hash) } ;
56505654 let ( mut new_outpoints, mut new_outputs) =
56515655 self . generate_claimable_outpoints_and_watch_outputs ( Some ( reason) ) ;
5652- if !self . is_manual_broadcast || self . funding_seen_onchain {
5653- claimable_outpoints. append ( & mut new_outpoints) ;
5654- watch_outputs. append ( & mut new_outputs) ;
5655- }
5656+ claimable_outpoints. append ( & mut new_outpoints) ;
5657+ watch_outputs. append ( & mut new_outputs) ;
56565658 }
56575659 }
56585660
0 commit comments