@@ -9451,9 +9451,10 @@ where
9451
9451
let mut tx_signatures = None;
9452
9452
let mut tx_abort = None;
9453
9453
9454
- // if next_funding is set:
9454
+ // A receiving node:
9455
+ // - if the `next_funding` TLV is set:
9455
9456
if let Some(next_funding) = &msg.next_funding {
9456
- // - if `next_funding ` matches the latest interactive funding transaction
9457
+ // - if `next_funding_txid ` matches the latest interactive funding transaction
9457
9458
// or the current channel funding transaction:
9458
9459
if let Some(session) = &self.context.interactive_tx_signing_session {
9459
9460
let our_next_funding_txid = session.unsigned_tx().compute_txid();
@@ -9468,8 +9469,12 @@ where
9468
9469
self.context.expecting_peer_commitment_signed = true;
9469
9470
}
9470
9471
9471
- // TODO(splicing): Add comment for spec requirements
9472
- if next_funding.should_retransmit(msgs::NextFundingFlag::CommitmentSigned) {
9472
+ // - if it has not received `tx_signatures` for that funding transaction:
9473
+ // - if the `commitment_signed` bit is set in `retransmit_flags`:
9474
+ if !session.has_received_tx_signatures()
9475
+ && next_funding.should_retransmit(msgs::NextFundingFlag::CommitmentSigned)
9476
+ {
9477
+ // - MUST retransmit its `commitment_signed` for that funding transaction.
9473
9478
let funding = self
9474
9479
.pending_splice
9475
9480
.as_ref()
@@ -11307,26 +11312,31 @@ where
11307
11312
}
11308
11313
11309
11314
fn maybe_get_next_funding(&self) -> Option<msgs::NextFunding> {
11310
- // If we've sent `commtiment_signed` for an interactively constructed transaction
11311
- // during a signing session, but have not received `tx_signatures` we MUST set `next_funding`
11312
- // to the txid of that interactive transaction, else we MUST NOT set it.
11315
+ // The sending node:
11316
+ // - if it has sent `commitment_signed` for an interactive transaction construction but
11317
+ // it has not received `tx_signatures`:
11313
11318
self.context
11314
11319
.interactive_tx_signing_session
11315
11320
.as_ref()
11316
11321
.filter(|session| !session.has_received_tx_signatures())
11317
11322
.map(|signing_session| {
11323
+ // - MUST include the `next_funding` TLV.
11324
+ // - MUST set `next_funding_txid` to the txid of that interactive transaction.
11318
11325
let mut next_funding = msgs::NextFunding {
11319
11326
txid: signing_session.unsigned_tx().compute_txid(),
11320
11327
retransmit_flags: 0,
11321
11328
};
11322
11329
11323
- // TODO(splicing): Add comment for spec requirements
11330
+ // - if it has not received `commitment_signed` for this `next_funding_txid`:
11331
+ // - MUST set the `commitment_signed` bit in `retransmit_flags`.
11324
11332
if !signing_session.has_received_commitment_signed() {
11325
11333
next_funding.retransmit(msgs::NextFundingFlag::CommitmentSigned);
11326
11334
}
11327
11335
11328
11336
next_funding
11329
11337
})
11338
+ // - otherwise:
11339
+ // - MUST NOT include the `next_funding` TLV.
11330
11340
}
11331
11341
11332
11342
fn maybe_get_my_current_funding_locked(&self) -> Option<msgs::FundingLocked> {
0 commit comments