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 holder_selected_contest_delay < BREAKDOWN_TIMEOUT{
521
532
returnErr(APIError::APIMisuseError{err:format!("Configured with an unreasonable our_to_self_delay ({}) putting user funds at risks", holder_selected_contest_delay)});
returnErr(APIError::FeeRateTooHigh{err:format!("Not enough reserve above dust limit can be found at current fee rate({})",background_feerate),feerate: background_feerate});
if msg.max_accepted_htlcs < config.peer_channel_config_limits.min_max_accepted_htlcs{
701
712
returnErr(ChannelError::Close(format!("max_accepted_htlcs ({}) is less than the user specified limit ({})", msg.max_accepted_htlcs, config.peer_channel_config_limits.min_max_accepted_htlcs)));
702
713
}
703
-
if msg.dust_limit_satoshis < config.peer_channel_config_limits.min_dust_limit_satoshis{
704
-
returnErr(ChannelError::Close(format!("dust_limit_satoshis ({}) is less than the user specified limit ({})", msg.dust_limit_satoshis,config.peer_channel_config_limits.min_dust_limit_satoshis)));
714
+
if msg.dust_limit_satoshis < MIN_DUST_LIMIT_SATOSHIS{
715
+
returnErr(ChannelError::Close(format!("dust_limit_satoshis ({}) is less than the implementation limit ({})", msg.dust_limit_satoshis,MIN_DUST_LIMIT_SATOSHIS)));
705
716
}
706
-
if msg.dust_limit_satoshis > config.peer_channel_config_limits.max_dust_limit_satoshis{
707
-
returnErr(ChannelError::Close(format!("dust_limit_satoshis ({}) is greater than the user specified limit ({})", msg.dust_limit_satoshis,config.peer_channel_config_limits.max_dust_limit_satoshis)));
717
+
if msg.dust_limit_satoshis > MAX_DUST_LIMIT_SATOSHIS{
718
+
returnErr(ChannelError::Close(format!("dust_limit_satoshis ({}) is greater than the implementation limit ({})", msg.dust_limit_satoshis,MAX_DUST_LIMIT_SATOSHIS)));
708
719
}
709
720
710
721
// Convert things into internal flags and prep our state:
let background_feerate = fee_estimator.get_est_sat_per_1000_weight(ConfirmationTarget::Background);
722
733
723
-
let holder_dust_limit_satoshis = Channel::<Signer>::derive_holder_dust_limit_satoshis(background_feerate);
724
734
let holder_selected_channel_reserve_satoshis = Channel::<Signer>::get_holder_selected_channel_reserve_satoshis(msg.funding_satoshis);
725
-
if holder_selected_channel_reserve_satoshis < holder_dust_limit_satoshis{
726
-
returnErr(ChannelError::Close(format!("Suitable channel reserve not found. remote_channel_reserve was ({}). dust_limit_satoshis is ({}).", holder_selected_channel_reserve_satoshis,holder_dust_limit_satoshis)));
735
+
if holder_selected_channel_reserve_satoshis < MIN_DUST_LIMIT_SATOSHIS{
736
+
returnErr(ChannelError::Close(format!("Suitable channel reserve not found. remote_channel_reserve was ({}). dust_limit_satoshis is ({}).", holder_selected_channel_reserve_satoshis,MIN_DUST_LIMIT_SATOSHIS)));
727
737
}
728
-
if msg.channel_reserve_satoshis < holder_dust_limit_satoshis{
729
-
returnErr(ChannelError::Close(format!("channel_reserve_satoshis ({}) is smaller than our dust limit ({})", msg.channel_reserve_satoshis,holder_dust_limit_satoshis)));
738
+
if msg.channel_reserve_satoshis < MIN_DUST_LIMIT_SATOSHIS{
739
+
returnErr(ChannelError::Close(format!("channel_reserve_satoshis ({}) is smaller than our dust limit ({})", msg.channel_reserve_satoshis,MIN_DUST_LIMIT_SATOSHIS)));
730
740
}
731
741
if holder_selected_channel_reserve_satoshis < msg.dust_limit_satoshis{
732
742
returnErr(ChannelError::Close(format!("Dust limit ({}) too high for the channel reserve we require the remote to keep ({})", msg.dust_limit_satoshis, holder_selected_channel_reserve_satoshis)));
if msg.max_accepted_htlcs < config.peer_channel_config_limits.min_max_accepted_htlcs{
1443
1453
returnErr(ChannelError::Close(format!("max_accepted_htlcs ({}) is less than the user specified limit ({})", msg.max_accepted_htlcs, config.peer_channel_config_limits.min_max_accepted_htlcs)));
1444
1454
}
1445
-
if msg.dust_limit_satoshis < config.peer_channel_config_limits.min_dust_limit_satoshis{
1446
-
returnErr(ChannelError::Close(format!("dust_limit_satoshis ({}) is less than the user specified limit ({})", msg.dust_limit_satoshis,config.peer_channel_config_limits.min_dust_limit_satoshis)));
1455
+
if msg.dust_limit_satoshis < MIN_DUST_LIMIT_SATOSHIS{
1456
+
returnErr(ChannelError::Close(format!("dust_limit_satoshis ({}) is less than the implementation limit ({})", msg.dust_limit_satoshis,MIN_DUST_LIMIT_SATOSHIS)));
1447
1457
}
1448
-
if msg.dust_limit_satoshis > config.peer_channel_config_limits.max_dust_limit_satoshis{
1449
-
returnErr(ChannelError::Close(format!("dust_limit_satoshis ({}) is greater than the user specified limit ({})", msg.dust_limit_satoshis,config.peer_channel_config_limits.max_dust_limit_satoshis)));
1458
+
if msg.dust_limit_satoshis > MAX_DUST_LIMIT_SATOSHIS{
1459
+
returnErr(ChannelError::Close(format!("dust_limit_satoshis ({}) is greater than the implementation limit ({})", msg.dust_limit_satoshis,MAX_DUST_LIMIT_SATOSHIS)));
1450
1460
}
1451
1461
if msg.minimum_depth > config.peer_channel_config_limits.max_minimum_depth{
1452
1462
returnErr(ChannelError::Close(format!("We consider the minimum depth to be unreasonably large. Expected minimum: ({}). Actual: ({})", config.peer_channel_config_limits.max_minimum_depth, msg.minimum_depth)));
let node_b_node_id = PublicKey::from_secret_key(&secp_ctx,&SecretKey::from_slice(&[7;32]).unwrap());
4944
4953
let node_b_chan = Channel::<EnforcingSigner>::new_from_req(&&feeest,&&keys_provider, node_b_node_id,InitFeatures::known(),&open_channel_msg,7,&config).unwrap();
0 commit comments