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
let holder_signer = keys_provider.get_channel_signer(false, channel_value_satoshis);
855
855
let pubkeys = holder_signer.pubkeys().clone();
856
856
857
-
if channel_value_satoshis >= MAX_FUNDING_SATOSHIS_NO_WUMBO{
858
-
returnErr(APIError::APIMisuseError{err:format!("funding_value must be smaller than {}, it was {}",MAX_FUNDING_SATOSHIS_NO_WUMBO, channel_value_satoshis)});
857
+
if !their_features.supports_wumbo() && channel_value_satoshis > MAX_FUNDING_SATOSHIS_NO_WUMBO{
858
+
returnErr(APIError::APIMisuseError{err:format!("funding_value must not exceed {}, it was {}",MAX_FUNDING_SATOSHIS_NO_WUMBO, channel_value_satoshis)});
859
+
}
860
+
if channel_value_satoshis >= TOTAL_BITCOIN_SUPPLY_SATOSHIS{
861
+
returnErr(APIError::APIMisuseError{err:format!("funding_value must be smaller than the total bitcoin supply, it was {}", channel_value_satoshis)});
859
862
}
860
863
let channel_value_msat = channel_value_satoshis *1000;
if msg.funding_satoshis >= MAX_FUNDING_SATOSHIS_NO_WUMBO{
1084
-
returnErr(ChannelError::Close(format!("Funding must be smaller than {}. It was {}",MAX_FUNDING_SATOSHIS_NO_WUMBO, msg.funding_satoshis)));
1086
+
if msg.funding_satoshis > config.peer_channel_config_limits.max_funding_satoshis{
1087
+
returnErr(ChannelError::Close(format!("Per our config, funding must be at most {}. It was {}", config.peer_channel_config_limits.max_funding_satoshis, msg.funding_satoshis)));
1088
+
}
1089
+
if msg.funding_satoshis >= TOTAL_BITCOIN_SUPPLY_SATOSHIS{
1090
+
returnErr(ChannelError::Close(format!("Funding must be smaller than the total bitcoin supply. It was {}", msg.funding_satoshis)));
1085
1091
}
1086
1092
if msg.channel_reserve_satoshis > msg.funding_satoshis{
1087
1093
returnErr(ChannelError::Close(format!("Bogus channel_reserve_satoshis ({}). Must be not greater than funding_satoshis: {}", msg.channel_reserve_satoshis, msg.funding_satoshis)));
use ln::channelmanager::MAX_LOCAL_BREAKDOWN_TIMEOUT;
97
99
98
100
// Test all mutations that would make the channel open message insane
99
-
insane_open_helper(format!("Funding must be smaller than {}. It was {}",MAX_FUNDING_SATOSHIS_NO_WUMBO,MAX_FUNDING_SATOSHIS_NO_WUMBO).as_str(), |mut msg| { msg.funding_satoshis = MAX_FUNDING_SATOSHIS_NO_WUMBO; msg });
101
+
insane_open_helper(format!("Per our config, funding must be at most {}. It was {}",TOTAL_BITCOIN_SUPPLY_SATOSHIS + 1,TOTAL_BITCOIN_SUPPLY_SATOSHIS + 2).as_str(), |mut msg| { msg.funding_satoshis = TOTAL_BITCOIN_SUPPLY_SATOSHIS + 2; msg });
102
+
insane_open_helper(format!("Funding must be smaller than the total bitcoin supply. It was {}",TOTAL_BITCOIN_SUPPLY_SATOSHIS).as_str(), |mut msg| { msg.funding_satoshis = TOTAL_BITCOIN_SUPPLY_SATOSHIS; msg });
0 commit comments