Skip to content

Commit 8ec81ef

Browse files
committed
Add pending funding scopes to FundedChannel
Once a channel is funded, it may be spliced to add or remove funds. The new funding transaction is pending until confirmed on chain and thus needs to be tracked. Additionally, it may be replaced by another transaction using RBF with a higher fee. Hence, there may be more than one pending FundingScope to track for a splice. This commit adds support for tracking pending funding scopes. The following commits will account for any pending scopes where applicable (e.g., when handling commitment_signed).
1 parent e9f3e4d commit 8ec81ef

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lightning/src/ln/channel.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1513,6 +1513,7 @@ impl<SP: Deref> Channel<SP> where
15131513
};
15141514
let mut funded_channel = FundedChannel {
15151515
funding: chan.funding,
1516+
pending_funding: vec![],
15161517
context: chan.context,
15171518
interactive_tx_signing_session: chan.interactive_tx_signing_session,
15181519
holder_commitment_point,
@@ -4820,6 +4821,7 @@ pub(super) struct DualFundingChannelContext {
48204821
// Counterparty designates channel data owned by the another channel participant entity.
48214822
pub(super) struct FundedChannel<SP: Deref> where SP::Target: SignerProvider {
48224823
pub funding: FundingScope,
4824+
pending_funding: Vec<FundingScope>,
48234825
pub context: ChannelContext<SP>,
48244826
pub interactive_tx_signing_session: Option<InteractiveTxSigningSession>,
48254827
holder_commitment_point: HolderCommitmentPoint,
@@ -9278,6 +9280,7 @@ impl<SP: Deref> OutboundV1Channel<SP> where SP::Target: SignerProvider {
92789280

92799281
let mut channel = FundedChannel {
92809282
funding: self.funding,
9283+
pending_funding: vec![],
92819284
context: self.context,
92829285
interactive_tx_signing_session: None,
92839286
is_v2_established: false,
@@ -9545,6 +9548,7 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
95459548
// `ChannelMonitor`.
95469549
let mut channel = FundedChannel {
95479550
funding: self.funding,
9551+
pending_funding: vec![],
95489552
context: self.context,
95499553
interactive_tx_signing_session: None,
95509554
is_v2_established: false,
@@ -10785,6 +10789,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, &'c Channel
1078510789
channel_transaction_parameters: channel_parameters,
1078610790
funding_transaction,
1078710791
},
10792+
pending_funding: vec![],
1078810793
context: ChannelContext {
1078910794
user_id,
1079010795

0 commit comments

Comments
 (0)