Skip to content

Commit ce253d2

Browse files
committed
Add interactive tx constructor to ChannelContext
1 parent f908780 commit ce253d2

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

lightning/src/ln/channel.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use bitcoin::secp256k1;
2727

2828
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash};
2929
use crate::ln::features::{ChannelTypeFeatures, InitFeatures};
30+
use crate::ln::interactivetxs::InteractiveTxConstructor;
3031
use crate::ln::msgs;
3132
use crate::ln::msgs::DecodeError;
3233
use crate::ln::script::{self, ShutdownScript};
@@ -3636,6 +3637,8 @@ pub(super) struct DualFundingChannelContext {
36363637
pub(super) struct Channel<SP: Deref> where SP::Target: SignerProvider {
36373638
pub context: ChannelContext<SP>,
36383639
pub dual_funding_channel_context: Option<DualFundingChannelContext>,
3640+
/// The current interactive transaction construction session under negotiation.
3641+
interactive_tx_constructor: Option<InteractiveTxConstructor>,
36393642
}
36403643

36413644
#[cfg(any(test, fuzzing))]
@@ -7775,6 +7778,7 @@ impl<SP: Deref> OutboundV1Channel<SP> where SP::Target: SignerProvider {
77757778
let mut channel = Channel {
77767779
context: self.context,
77777780
dual_funding_channel_context: None,
7781+
interactive_tx_constructor: None,
77787782
};
77797783

77807784
let need_channel_ready = channel.check_get_channel_ready(0, logger).is_some();
@@ -7883,7 +7887,7 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
78837887
msg.push_msat,
78847888
msg.common_fields.clone(),
78857889
)?,
7886-
unfunded_context: UnfundedChannelContext { unfunded_channel_age_ticks: 0 }
7890+
unfunded_context: UnfundedChannelContext { unfunded_channel_age_ticks: 0 },
78877891
};
78887892
Ok(chan)
78897893
}
@@ -8065,6 +8069,7 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
80658069
let mut channel = Channel {
80668070
context: self.context,
80678071
dual_funding_channel_context: None,
8072+
interactive_tx_constructor: None,
80688073
};
80698074
let need_channel_ready = channel.check_get_channel_ready(0, logger).is_some();
80708075
channel.monitor_updating_paused(false, false, need_channel_ready, Vec::new(), Vec::new(), Vec::new());
@@ -8078,6 +8083,8 @@ pub(super) struct OutboundV2Channel<SP: Deref> where SP::Target: SignerProvider
80788083
pub context: ChannelContext<SP>,
80798084
pub unfunded_context: UnfundedChannelContext,
80808085
pub dual_funding_context: DualFundingChannelContext,
8086+
/// The current interactive transaction construction session under negotiation.
8087+
interactive_tx_constructor: Option<InteractiveTxConstructor>,
80818088
}
80828089

80838090
impl<SP: Deref> OutboundV2Channel<SP> where SP::Target: SignerProvider {
@@ -8127,7 +8134,8 @@ impl<SP: Deref> OutboundV2Channel<SP> where SP::Target: SignerProvider {
81278134
their_funding_satoshis: 0,
81288135
funding_tx_locktime,
81298136
funding_feerate_sat_per_1000_weight,
8130-
}
8137+
},
8138+
interactive_tx_constructor: None,
81318139
};
81328140
Ok(chan)
81338141
}
@@ -8199,6 +8207,8 @@ pub(super) struct InboundV2Channel<SP: Deref> where SP::Target: SignerProvider {
81998207
pub context: ChannelContext<SP>,
82008208
pub unfunded_context: UnfundedChannelContext,
82018209
pub dual_funding_context: DualFundingChannelContext,
8210+
/// The current interactive transaction construction session under negotiation.
8211+
interactive_tx_constructor: Option<InteractiveTxConstructor>,
82028212
}
82038213

82048214
impl<SP: Deref> InboundV2Channel<SP> where SP::Target: SignerProvider {
@@ -8270,7 +8280,8 @@ impl<SP: Deref> InboundV2Channel<SP> where SP::Target: SignerProvider {
82708280
their_funding_satoshis: msg.common_fields.funding_satoshis,
82718281
funding_tx_locktime: msg.locktime,
82728282
funding_feerate_sat_per_1000_weight: msg.funding_feerate_sat_per_1000_weight,
8273-
}
8283+
},
8284+
interactive_tx_constructor: None,
82748285
};
82758286

82768287
Ok(chan)
@@ -9396,6 +9407,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
93969407
blocked_monitor_updates: blocked_monitor_updates.unwrap(),
93979408
},
93989409
dual_funding_channel_context: None,
9410+
interactive_tx_constructor: None,
93999411
})
94009412
}
94019413
}

0 commit comments

Comments
 (0)