You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if !shutdown_scriptpubkey.is_compatible(&their_features){
604
+
if !shutdown_scriptpubkey.is_compatible(their_features){
605
605
returnErr(APIError::APIMisuseError{err:format!("Provided a scriptpubkey format not accepted by peer. script: ({})", shutdown_scriptpubkey.clone().into_inner().to_bytes().to_hex())});
Err(_) => returnErr(ChannelError::Close(format!("Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. script: ({})", script.to_bytes().to_hex()))),
Err(_) => returnErr(ChannelError::Close(format!("Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. script: ({})", script.to_bytes().to_hex()))),
1578
1578
}
@@ -5241,7 +5241,7 @@ mod tests {
5241
5241
5242
5242
let node_a_node_id = PublicKey::from_secret_key(&secp_ctx,&SecretKey::from_slice(&[42;32]).unwrap());
5243
5243
let config = UserConfig::default();
5244
-
let node_a_chan = Channel::<EnforcingSigner>::new_outbound(&&fee_est,&&keys_provider, node_a_node_id,InitFeatures::known(),10000000,100000,42,&config).unwrap();
5244
+
let node_a_chan = Channel::<EnforcingSigner>::new_outbound(&&fee_est,&&keys_provider, node_a_node_id,&InitFeatures::known(),10000000,100000,42,&config).unwrap();
5245
5245
5246
5246
// Now change the fee so we can check that the fee in the open_channel message is the
5247
5247
// same as the old fee.
@@ -5266,18 +5266,18 @@ mod tests {
5266
5266
// Create Node A's channel pointing to Node B's pubkey
5267
5267
let node_b_node_id = PublicKey::from_secret_key(&secp_ctx,&SecretKey::from_slice(&[42;32]).unwrap());
let open_channel_msg = node_a_chan.get_open_channel(genesis_block(network).header.block_hash());
5274
5274
let node_b_node_id = PublicKey::from_secret_key(&secp_ctx,&SecretKey::from_slice(&[7;32]).unwrap());
5275
-
let node_b_chan = Channel::<EnforcingSigner>::new_from_req(&&feeest,&&keys_provider, node_b_node_id,InitFeatures::known(),&open_channel_msg,7,&config).unwrap();
5275
+
let node_b_chan = Channel::<EnforcingSigner>::new_from_req(&&feeest,&&keys_provider, node_b_node_id,&InitFeatures::known(),&open_channel_msg,7,&config).unwrap();
let counterparty_node_id = PublicKey::from_secret_key(&secp_ctx,&SecretKey::from_slice(&[42;32]).unwrap());
5509
5509
letmut config = UserConfig::default();
5510
5510
config.channel_options.announced_channel = false;
5511
-
letmut chan = Channel::<InMemorySigner>::new_outbound(&&feeest,&&keys_provider, counterparty_node_id,InitFeatures::known(),10_000_000,100000,42,&config).unwrap();// Nothing uses their network key in this test
5511
+
letmut chan = Channel::<InMemorySigner>::new_outbound(&&feeest,&&keys_provider, counterparty_node_id,&InitFeatures::known(),10_000_000,100000,42,&config).unwrap();// Nothing uses their network key in this test
5512
5512
chan.holder_dust_limit_satoshis = 546;
5513
5513
chan.counterparty_selected_channel_reserve_satoshis = Some(0);// Filled in in accept_channel
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
7751
7751
7752
7752
// We test config.our_to_self > BREAKDOWN_TIMEOUT is enforced in Channel::new_outbound()
7753
-
if let Err(error) = Channel::new_outbound(&&test_utils::TestFeeEstimator { sat_per_kw: Mutex::new(253) }, &nodes[0].keys_manager, nodes[1].node.get_our_node_id(), InitFeatures::known(), 1000000, 1000000, 0, &low_our_to_self_config) {
7753
+
if let Err(error) = Channel::new_outbound(&&test_utils::TestFeeEstimator { sat_per_kw: Mutex::new(253) }, &nodes[0].keys_manager, nodes[1].node.get_our_node_id(), &InitFeatures::known(), 1000000, 1000000, 0, &low_our_to_self_config) {
7754
7754
match error {
7755
7755
APIError::APIMisuseError { err } => { assert!(regex::Regex::new(r"Configured with an unreasonable our_to_self_delay \(\d+\) putting user funds at risks").unwrap().is_match(err.as_str())); },
let mut open_channel = get_event_msg!(nodes[1], MessageSendEvent::SendOpenChannel, nodes[0].node.get_our_node_id());
7763
7763
open_channel.to_self_delay = 200;
7764
-
if let Err(error) = Channel::new_from_req(&&test_utils::TestFeeEstimator { sat_per_kw: Mutex::new(253) }, &nodes[0].keys_manager, nodes[1].node.get_our_node_id(), InitFeatures::known(), &open_channel, 0, &low_our_to_self_config) {
7764
+
if let Err(error) = Channel::new_from_req(&&test_utils::TestFeeEstimator { sat_per_kw: Mutex::new(253) }, &nodes[0].keys_manager, nodes[1].node.get_our_node_id(), &InitFeatures::known(), &open_channel, 0, &low_our_to_self_config) {
7765
7765
match error {
7766
7766
ChannelError::Close(err) => { assert!(regex::Regex::new(r"Configured with an unreasonable our_to_self_delay \(\d+\) putting user funds at risks").unwrap().is_match(err.as_str())); },
let mut open_channel = get_event_msg!(nodes[1], MessageSendEvent::SendOpenChannel, nodes[0].node.get_our_node_id());
7789
7789
open_channel.to_self_delay = 200;
7790
-
if let Err(error) = Channel::new_from_req(&&test_utils::TestFeeEstimator { sat_per_kw: Mutex::new(253) }, &nodes[0].keys_manager, nodes[1].node.get_our_node_id(), InitFeatures::known(), &open_channel, 0, &high_their_to_self_config) {
7790
+
if let Err(error) = Channel::new_from_req(&&test_utils::TestFeeEstimator { sat_per_kw: Mutex::new(253) }, &nodes[0].keys_manager, nodes[1].node.get_our_node_id(), &InitFeatures::known(), &open_channel, 0, &high_their_to_self_config) {
7791
7791
match error {
7792
7792
ChannelError::Close(err) => { assert!(regex::Regex::new(r"They wanted our payments to be delayed by a needlessly long period\. Upper limit: \d+\. Actual: \d+").unwrap().is_match(err.as_str())); },
0 commit comments