Skip to content

Commit ab9b82b

Browse files
committed
Introduce InteractiveTxSigningSession for signing interactively constructed txs
1 parent 755ce03 commit ab9b82b

File tree

3 files changed

+304
-38
lines changed

3 files changed

+304
-38
lines changed

lightning/src/ln/channel.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8564,7 +8564,7 @@ impl<SP: Deref> InboundV2Channel<SP> where SP::Target: SignerProvider {
85648564
/// Assumes chain_hash has already been checked and corresponds with what we expect!
85658565
pub fn new<ES: Deref, F: Deref, L: Deref>(
85668566
fee_estimator: &LowerBoundedFeeEstimator<F>, entropy_source: &ES, signer_provider: &SP,
8567-
counterparty_node_id: PublicKey, our_supported_features: &ChannelTypeFeatures,
8567+
holder_node_id: PublicKey, counterparty_node_id: PublicKey, our_supported_features: &ChannelTypeFeatures,
85688568
their_features: &InitFeatures, msg: &msgs::OpenChannelV2,
85698569
funding_inputs: Vec<(TxIn, TransactionU16LenLimited)>, total_witness_weight: Weight,
85708570
user_id: u128, config: &UserConfig, current_chain_height: u32, logger: &L,
@@ -8640,6 +8640,8 @@ impl<SP: Deref> InboundV2Channel<SP> where SP::Target: SignerProvider {
86408640
let interactive_tx_constructor = Some(InteractiveTxConstructor::new(
86418641
InteractiveTxConstructorArgs {
86428642
entropy_source,
8643+
holder_node_id,
8644+
counterparty_node_id,
86438645
channel_id: context.channel_id,
86448646
feerate_sat_per_kw: dual_funding_context.funding_feerate_sat_per_1000_weight,
86458647
funding_tx_locktime: dual_funding_context.funding_tx_locktime,

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7674,7 +7674,7 @@ where
76747674
},
76757675
OpenChannelMessage::V2(open_channel_msg) => {
76767676
InboundV2Channel::new(&self.fee_estimator, &self.entropy_source, &self.signer_provider,
7677-
*counterparty_node_id, &self.channel_type_features(), &peer_state.latest_features,
7677+
self.get_our_node_id(), *counterparty_node_id, &self.channel_type_features(), &peer_state.latest_features,
76787678
&open_channel_msg, funding_inputs, total_witness_weight, user_channel_id,
76797679
&self.default_configuration, best_block_height, &self.logger
76807680
).map_err(|_| MsgHandleErrInternal::from_chan_no_close(
@@ -7946,9 +7946,9 @@ where
79467946
},
79477947
OpenChannelMessageRef::V2(msg) => {
79487948
let channel = InboundV2Channel::new(&self.fee_estimator, &self.entropy_source,
7949-
&self.signer_provider, *counterparty_node_id, &self.channel_type_features(),
7950-
&peer_state.latest_features, msg, vec![], Weight::from_wu(0), user_channel_id,
7951-
&self.default_configuration, best_block_height, &self.logger
7949+
&self.signer_provider, self.get_our_node_id(), *counterparty_node_id,
7950+
&self.channel_type_features(), &peer_state.latest_features, msg, vec![], Weight::from_wu(0),
7951+
user_channel_id, &self.default_configuration, best_block_height, &self.logger
79527952
).map_err(|e| MsgHandleErrInternal::from_chan_no_close(e, msg.common_fields.temporary_channel_id))?;
79537953
let message_send_event = events::MessageSendEvent::SendAcceptChannelV2 {
79547954
node_id: *counterparty_node_id,

0 commit comments

Comments
 (0)