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(ChannelError::Close(format!("Funding must be smaller than {}. It was {}",MAX_FUNDING_SATOSHIS, msg.funding_satoshis)));
1097
+
if msg.funding_satoshis > config.peer_channel_config_limits.max_funding_satoshis{
1098
+
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)));
1099
+
}
1100
+
if msg.funding_satoshis >= TOTAL_BITCOIN_SUPPLY_SATOSHIS{
1101
+
returnErr(ChannelError::Close(format!("Funding must be smaller than the total bitcoin supply. It was {}", msg.funding_satoshis)));
1092
1102
}
1093
1103
if msg.channel_reserve_satoshis > msg.funding_satoshis{
1094
1104
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
+
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