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 config.own_channel_config.our_to_self_delay < BREAKDOWN_TIMEOUT{
589
-
returnErr(ChannelError::Close(format!("Configured with an unreasonable our_to_self_delay ({}) putting user funds at risks. It must be lower than {}", config.own_channel_config.our_to_self_delay,BREAKDOWN_TIMEOUT)));
589
+
returnErr(ChannelError::Close(format!("Configured with an unreasonable our_to_self_delay ({}) putting user funds at risks. It must be greater than {}", config.own_channel_config.our_to_self_delay,BREAKDOWN_TIMEOUT)));
590
590
}
591
591
592
592
// Check sanity of message fields:
593
593
if msg.funding_satoshis >= MAX_FUNDING_SATOSHIS{
594
-
returnErr(ChannelError::Close(format!("Funding must be smaller than {}. It was {}", msg.funding_satoshis,MAX_FUNDING_SATOSHIS)));
594
+
returnErr(ChannelError::Close(format!("Funding must be smaller than {}. It was {}",MAX_FUNDING_SATOSHIS,msg.funding_satoshis)));
595
595
}
596
596
if msg.channel_reserve_satoshis > msg.funding_satoshis{
597
597
returnErr(ChannelError::Close(format!("Bogus channel_reserve_satoshis ({}). Must be not greater than funding_satoshis: {}", msg.channel_reserve_satoshis, msg.funding_satoshis)));
returnErr(ChannelError::Close(format!("Suitable channel reserve not found. remote_channel_reserve was ({}). our_dust_limit_satoshis is ({}).", remote_channel_reserve_satoshis, our_dust_limit_satoshis)));
666
666
}
667
667
if msg.channel_reserve_satoshis < our_dust_limit_satoshis {
668
-
returnErr(ChannelError::Close(format!("channel_reserve_satoshis ({}) is small than our dust limit ({})", msg.channel_reserve_satoshis, our_dust_limit_satoshis)));
668
+
returnErr(ChannelError::Close(format!("channel_reserve_satoshis ({}) is smaller than our dust limit ({})", msg.channel_reserve_satoshis, our_dust_limit_satoshis)));
669
669
}
670
670
if remote_channel_reserve_satoshis < msg.dust_limit_satoshis{
671
671
returnErr(ChannelError::Close(format!("Dust limit ({}) too high for the channel reserve we require the remote to keep ({})", msg.dust_limit_satoshis, remote_channel_reserve_satoshis)));
let remote_reserve = Channel::<ChanSigner>::get_remote_channel_reserve_satoshis(self.channel_value_satoshis);
1389
1389
if msg.dust_limit_satoshis > remote_reserve {
1390
-
returnErr(ChannelError::Close(format!("Dust limit ({}) is bigger than our channel reverse ({})", msg.dust_limit_satoshis, remote_reserve)));
1390
+
returnErr(ChannelError::Close(format!("Dust limit ({}) is bigger than our channel reserve ({})", msg.dust_limit_satoshis, remote_reserve)));
1391
1391
}
1392
1392
let full_channel_value_msat = (self.channel_value_satoshis - msg.channel_reserve_satoshis)*1000;
1393
1393
if msg.htlc_minimum_msat >= full_channel_value_msat {
1394
1394
returnErr(ChannelError::Close(format!("Minimum htlc value ({}) is full channel value ({})", msg.htlc_minimum_msat, full_channel_value_msat)));
1395
1395
}
1396
1396
let max_delay_acceptable = u16::min(config.peer_channel_config_limits.their_to_self_delay,MAX_LOCAL_BREAKDOWN_TIMEOUT);
1397
1397
if msg.to_self_delay > max_delay_acceptable {
1398
-
returnErr(ChannelError::Close(format!("They wanted our payments to be delayed by a needlessly long period. Upper limit: {}. Actual: {}", msg.to_self_delay, max_delay_acceptable)));
1398
+
returnErr(ChannelError::Close(format!("They wanted our payments to be delayed by a needlessly long period. Upper limit: {}. Actual: {}",max_delay_acceptable,msg.to_self_delay)));
1399
1399
}
1400
1400
if msg.max_accepted_htlcs < 1{
1401
1401
returnErr(ChannelError::Close("0 max_accepted_htlcs makes for a useless channel".to_owned()));
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)));
1425
1425
}
1426
1426
if msg.minimum_depth > config.peer_channel_config_limits.max_minimum_depth{
1427
-
returnErr(ChannelError::Close(format!("We consider the minimum depth to be unreasonably large. Expected minimum: ({}). Actual: ({})",msg.minimum_depth,config.peer_channel_config_limits.max_minimum_depth)));
1427
+
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)));
1428
1428
}
1429
1429
1430
1430
let their_shutdown_scriptpubkey = if their_features.supports_upfront_shutdown_script(){
// Peer is signaling upfront_shutdown and has provided a non-accepted scriptpubkey format. Fail the channel
1440
1440
}else{
1441
-
returnErr(ChannelError::Close(format!("Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. scirptpubkey: ({})", script.to_bytes().to_hex())));
1441
+
returnErr(ChannelError::Close(format!("Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. scriptpubkey: ({})", script.to_bytes().to_hex())));
1442
1442
}
1443
1443
},
1444
1444
// Peer is signaling upfront shutdown but don't opt-out with correct mechanism (a.k.a 0-length script). Peer looks buggy, we fail the channel
returnErr(ChannelError::Close("Remote side tried to send a 0-msat HTLC".to_owned()));
1786
1786
}
1787
1787
if msg.amount_msat < self.our_htlc_minimum_msat{
1788
-
returnErr(ChannelError::Close(format!("Remote side tried to send less than our minimum HTLC value. lower limit: ({}). actual: ({})",msg.amount_msat,self.our_htlc_minimum_msat)));
1788
+
returnErr(ChannelError::Close(format!("Remote side tried to send less than our minimum HTLC value. Lower limit: ({}). Actual: ({})",self.our_htlc_minimum_msat, msg.amount_msat)));
returnErr(ChannelError::Close(format!("Remote sent us a closing_signed with a fee greater than the value they can claim. actual: {}", msg.fee_satoshis)));
3015
+
returnErr(ChannelError::Close(format!("Remote sent us a closing_signed with a fee greater than the value they can claim. Fee in message: {}", msg.fee_satoshis)));
returnErr(ChannelError::Close(format!("Unable to come to consensus about closing feerate, remote wanted something lower ({}) than our Background feerate. ({})", last_feerate, our_min_feerate)));
3073
+
returnErr(ChannelError::Close(format!("Unable to come to consensus about closing feerate, remote wanted something lower ({}) than our Background feerate ({}).", last_feerate, our_min_feerate)));
0 commit comments