Skip to content

Commit ef38903

Browse files
Queue holder commit once funding tx confirms
Sets should_broadcast_commitment=true when funding confirms. Since we skip the initial broadcast when funding_seen_onchain is false, we need to queue it once funding actually hits the chain.
1 parent 1f9ee40 commit ef38903

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5260,6 +5260,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
52605260
F::Target: FeeEstimator,
52615261
L::Target: Logger,
52625262
{
5263+
let funding_seen_before = self.funding_seen_onchain;
52635264
let txn_matched = self.filter_block(txdata);
52645265
for tx in &txn_matched {
52655266
let mut output_val = Amount::ZERO;
@@ -5281,6 +5282,11 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
52815282

52825283
let mut watch_outputs = Vec::new();
52835284
let mut claimable_outpoints = Vec::new();
5285+
5286+
if self.is_manual_broadcast && !funding_seen_before && self.funding_seen_onchain && self.holder_tx_signed
5287+
{
5288+
should_broadcast_commitment = true;
5289+
}
52845290
'tx_iter: for tx in &txn_matched {
52855291
let txid = tx.compute_txid();
52865292
log_trace!(logger, "Transaction {} confirmed in block {}", txid , block_hash);

0 commit comments

Comments
 (0)