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
returnErr(APIError::APIMisuseError{err:format!("Configured with an unreasonable our_to_self_delay ({}) putting user funds at risks", holder_selected_contest_delay)});
522
523
}
523
524
let background_feerate = fee_estimator.get_est_sat_per_1000_weight(ConfirmationTarget::Background);
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{
698
699
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)));
699
700
}
700
-
if msg.dust_limit_satoshis < config.peer_channel_config_limits.min_dust_limit_satoshis{
701
-
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)));
701
+
if msg.dust_limit_satoshis < HOLDER_DUST_LIMIT_SATOSHIS{
702
+
returnErr(ChannelError::Close(format!("dust_limit_satoshis ({}) is less than the user specified limit ({})", msg.dust_limit_satoshis,HOLDER_DUST_LIMIT_SATOSHIS)));
702
703
}
703
704
if msg.dust_limit_satoshis > MAX_DUST_LIMIT_SATOSHIS{
704
705
returnErr(ChannelError::Close(format!("dust_limit_satoshis ({}) is greater than the implementation limit ({})", msg.dust_limit_satoshis,MAX_DUST_LIMIT_SATOSHIS)));
let background_feerate = fee_estimator.get_est_sat_per_1000_weight(ConfirmationTarget::Background);
719
720
720
-
let holder_dust_limit_satoshis = Channel::<Signer>::derive_holder_dust_limit_satoshis(background_feerate);
721
721
let holder_selected_channel_reserve_satoshis = Channel::<Signer>::get_holder_selected_channel_reserve_satoshis(msg.funding_satoshis);
722
-
if holder_selected_channel_reserve_satoshis < holder_dust_limit_satoshis{
723
-
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)));
722
+
if holder_selected_channel_reserve_satoshis < HOLDER_DUST_LIMIT_SATOSHIS{
723
+
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)));
724
724
}
725
-
if msg.channel_reserve_satoshis < holder_dust_limit_satoshis{
726
-
returnErr(ChannelError::Close(format!("channel_reserve_satoshis ({}) is smaller than our dust limit ({})", msg.channel_reserve_satoshis,holder_dust_limit_satoshis)));
725
+
if msg.channel_reserve_satoshis < HOLDER_DUST_LIMIT_SATOSHIS{
726
+
returnErr(ChannelError::Close(format!("channel_reserve_satoshis ({}) is smaller than our dust limit ({})", msg.channel_reserve_satoshis,HOLDER_DUST_LIMIT_SATOSHIS)));
727
727
}
728
728
if holder_selected_channel_reserve_satoshis < msg.dust_limit_satoshis{
729
729
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{
1437
1437
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)));
1438
1438
}
1439
-
if msg.dust_limit_satoshis < config.peer_channel_config_limits.min_dust_limit_satoshis{
1440
-
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)));
1439
+
if msg.dust_limit_satoshis < HOLDER_DUST_LIMIT_SATOSHIS{
1440
+
returnErr(ChannelError::Close(format!("dust_limit_satoshis ({}) is less than the user specified limit ({})", msg.dust_limit_satoshis,HOLDER_DUST_LIMIT_SATOSHIS)));
1441
1441
}
1442
1442
if msg.dust_limit_satoshis > MAX_DUST_LIMIT_SATOSHIS{
1443
1443
returnErr(ChannelError::Close(format!("dust_limit_satoshis ({}) is greater than the implementation limit ({})", msg.dust_limit_satoshis,MAX_DUST_LIMIT_SATOSHIS)));
let node_b_node_id = PublicKey::from_secret_key(&secp_ctx,&SecretKey::from_slice(&[7;32]).unwrap());
4823
4822
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