Skip to content

Commit e247652

Browse files
committed
f - allow change script
1 parent f312357 commit e247652

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

lightning/src/ln/channel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14110,7 +14110,7 @@ where
1411014110
holder_node_id: PublicKey, counterparty_node_id: PublicKey, our_supported_features: &ChannelTypeFeatures,
1411114111
their_features: &InitFeatures, msg: &msgs::OpenChannelV2, user_id: u128, config: &UserConfig,
1411214112
current_chain_height: u32, logger: &L, our_funding_contribution: Amount,
14113-
our_funding_inputs: Vec<FundingTxInput>,
14113+
our_funding_inputs: Vec<FundingTxInput>, change_script: Option<ScriptBuf>,
1411414114
) -> Result<Self, ChannelError>
1411514115
where ES::Target: EntropySource,
1411614116
F::Target: FeeEstimator,
@@ -14170,7 +14170,7 @@ where
1417014170
shared_funding_input: None,
1417114171
our_funding_inputs: our_funding_inputs.clone(),
1417214172
our_funding_outputs: Vec::new(),
14173-
change_script: None,
14173+
change_script,
1417414174
};
1417514175

1417614176
let mut interactive_tx_constructor = funding_negotiation_context

lightning/src/ln/channelmanager.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use bitcoin::hashes::{Hash, HashEngine, HmacEngine};
3030

3131
use bitcoin::secp256k1::Secp256k1;
3232
use bitcoin::secp256k1::{PublicKey, SecretKey};
33-
use bitcoin::{secp256k1, Amount, Sequence};
33+
use bitcoin::{secp256k1, Amount, ScriptBuf, Sequence};
3434

3535
use crate::blinded_path::message::{
3636
AsyncPaymentsContext, BlindedMessagePath, MessageForwardNode, OffersContext,
@@ -9816,6 +9816,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
98169816
config_overrides,
98179817
Amount::ZERO,
98189818
vec![],
9819+
None,
98199820
)
98209821
}
98219822

@@ -9849,6 +9850,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
98499850
config_overrides,
98509851
Amount::ZERO,
98519852
vec![],
9853+
None,
98529854
)
98539855
}
98549856

@@ -9887,6 +9889,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
98879889
&self, temporary_channel_id: &ChannelId, counterparty_node_id: &PublicKey,
98889890
user_channel_id: u128, config_overrides: Option<ChannelConfigOverrides>,
98899891
our_funding_contribution: Amount, funding_inputs: Vec<FundingTxInput>,
9892+
change_script: Option<ScriptBuf>,
98909893
) -> Result<(), APIError> {
98919894
self.do_accept_inbound_channel(
98929895
temporary_channel_id,
@@ -9896,14 +9899,16 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
98969899
config_overrides,
98979900
our_funding_contribution,
98989901
funding_inputs,
9902+
change_script,
98999903
)
99009904
}
99019905

99029906
#[rustfmt::skip]
99039907
fn do_accept_inbound_channel(
99049908
&self, temporary_channel_id: &ChannelId, counterparty_node_id: &PublicKey,
99059909
accept_0conf: bool, user_channel_id: u128, config_overrides: Option<ChannelConfigOverrides>,
9906-
our_funding_contribution: Amount, funding_inputs: Vec<FundingTxInput>
9910+
our_funding_contribution: Amount, funding_inputs: Vec<FundingTxInput>,
9911+
change_script: Option<ScriptBuf>,
99079912
) -> Result<(), APIError> {
99089913
if our_funding_contribution > Amount::MAX_MONEY {
99099914
return Err(APIError::APIMisuseError {
@@ -9967,7 +9972,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
99679972
&self.channel_type_features(), &peer_state.latest_features,
99689973
&open_channel_msg,
99699974
user_channel_id, &config, best_block_height,
9970-
&self.logger, our_funding_contribution, funding_inputs,
9975+
&self.logger, our_funding_contribution, funding_inputs, change_script,
99719976
).map_err(|e| {
99729977
let channel_id = open_channel_msg.common_fields.temporary_channel_id;
99739978
MsgHandleErrInternal::from_chan_no_close(e, channel_id)
@@ -10253,7 +10258,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1025310258
&self.fee_estimator, &self.entropy_source, &self.signer_provider,
1025410259
self.get_our_node_id(), *counterparty_node_id, &self.channel_type_features(),
1025510260
&peer_state.latest_features, msg, user_channel_id,
10256-
&self.config.read().unwrap(), best_block_height, &self.logger, Amount::ZERO, vec![],
10261+
&self.config.read().unwrap(), best_block_height, &self.logger, Amount::ZERO, vec![], None,
1025710262
).map_err(|e| MsgHandleErrInternal::from_chan_no_close(e, msg.common_fields.temporary_channel_id))?;
1025810263
let message_send_event = MessageSendEvent::SendAcceptChannelV2 {
1025910264
node_id: *counterparty_node_id,

0 commit comments

Comments
 (0)