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
We remove MAX_FUNDING_SATOSHIS const since we no longer do this check, and instead
check that the funding amount is less than the total bitcoin supply. This adds
a const that is used for the new wumbo feature as well as in closing_signed
returnErr(ChannelError::Close(format!("Funding must be smaller than {}. It was {}",MAX_FUNDING_SATOSHIS, msg.funding_satoshis)));
1078
+
if msg.funding_satoshis > config.peer_channel_config_limits.max_funding_satoshis{
1079
+
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)));
1080
+
}
1081
+
if msg.funding_satoshis >= TOTAL_BITCOIN_SUPPLY_SATOSHIS{
1082
+
returnErr(ChannelError::Close(format!("Funding must be smaller than the total bitcoin supply. It was {}", msg.funding_satoshis)));
1081
1083
}
1082
1084
if msg.channel_reserve_satoshis > msg.funding_satoshis{
1083
1085
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,MAX_FUNDING_SATOSHIS).as_str(), |mut msg| { msg.funding_satoshis = MAX_FUNDING_SATOSHIS; 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
+
103
+
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