Skip to content

Commit 943f176

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 f98ffba commit 943f176

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
@@ -5344,6 +5344,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
53445344
F::Target: FeeEstimator,
53455345
L::Target: Logger,
53465346
{
5347+
let funding_seen_before = self.funding_seen_onchain;
53475348
let txn_matched = self.filter_block(txdata);
53485349
for tx in &txn_matched {
53495350
let mut output_val = Amount::ZERO;
@@ -5365,6 +5366,11 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
53655366

53665367
let mut watch_outputs = Vec::new();
53675368
let mut claimable_outpoints = Vec::new();
5369+
5370+
if self.is_manual_broadcast && !funding_seen_before && self.funding_seen_onchain && self.holder_tx_signed
5371+
{
5372+
should_broadcast_commitment = true;
5373+
}
53685374
'tx_iter: for tx in &txn_matched {
53695375
let txid = tx.compute_txid();
53705376
log_trace!(logger, "Transaction {} confirmed in block {}", txid , block_hash);

0 commit comments

Comments
 (0)