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){
610
+
if !shutdown_scriptpubkey.is_compatible(their_features){
611
611
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 an unacceptable scriptpubkey format. script: ({})", script.to_bytes().to_hex()))),
Err(_) => returnErr(ChannelError::Close(format!("Peer is signaling upfront_shutdown but has provided an unacceptable scriptpubkey format. script: ({})", script.to_bytes().to_hex()))),
1591
1591
}
@@ -5259,7 +5259,7 @@ mod tests {
5259
5259
let secp_ctx = Secp256k1::new();
5260
5260
let node_id = PublicKey::from_secret_key(&secp_ctx,&SecretKey::from_slice(&[42;32]).unwrap());
assert_eq!(err,"Provided a scriptpubkey format not accepted by peer. script: (60020028)");
5265
5265
},
@@ -5281,7 +5281,7 @@ mod tests {
5281
5281
5282
5282
let node_a_node_id = PublicKey::from_secret_key(&secp_ctx,&SecretKey::from_slice(&[42;32]).unwrap());
5283
5283
let config = UserConfig::default();
5284
-
let node_a_chan = Channel::<EnforcingSigner>::new_outbound(&&fee_est,&&keys_provider, node_a_node_id,InitFeatures::known(),10000000,100000,42,&config).unwrap();
5284
+
let node_a_chan = Channel::<EnforcingSigner>::new_outbound(&&fee_est,&&keys_provider, node_a_node_id,&InitFeatures::known(),10000000,100000,42,&config).unwrap();
5285
5285
5286
5286
// Now change the fee so we can check that the fee in the open_channel message is the
5287
5287
// same as the old fee.
@@ -5306,18 +5306,18 @@ mod tests {
5306
5306
// Create Node A's channel pointing to Node B's pubkey
5307
5307
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());
5314
5314
let node_b_node_id = PublicKey::from_secret_key(&secp_ctx,&SecretKey::from_slice(&[7;32]).unwrap());
5315
-
let node_b_chan = Channel::<EnforcingSigner>::new_from_req(&&feeest,&&keys_provider, node_b_node_id,InitFeatures::known(),&open_channel_msg,7,&config).unwrap();
5315
+
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());
5549
5549
letmut config = UserConfig::default();
5550
5550
config.channel_options.announced_channel = false;
5551
-
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
5551
+
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
5552
5552
chan.holder_dust_limit_satoshis = 546;
5553
5553
chan.counterparty_selected_channel_reserve_satoshis = Some(0);// Filled in in accept_channel
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
7768
7768
7769
7769
// We test config.our_to_self > BREAKDOWN_TIMEOUT is enforced in Channel::new_outbound()
7770
-
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) {
7770
+
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) {
7771
7771
match error {
7772
7772
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());
7780
7780
open_channel.to_self_delay = 200;
7781
-
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) {
7781
+
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) {
7782
7782
match error {
7783
7783
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());
7806
7806
open_channel.to_self_delay = 200;
7807
-
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) {
7807
+
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) {
7808
7808
match error {
7809
7809
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