committed by
GitHub
parent
4e37c1c9e7
commit
eefd87aa2e
@@ -157,7 +157,9 @@ fn monitor_peers(
|
||||
let interval = Utc::now().timestamp() - x.last_banned;
|
||||
// Unban peer
|
||||
if interval >= config.ban_window() {
|
||||
peers.unban_peer(x.addr);
|
||||
if let Err(e) = peers.unban_peer(x.addr) {
|
||||
error!("failed to unban peer {}: {:?}", x.addr, e);
|
||||
}
|
||||
debug!(
|
||||
"monitor_peers: unbanned {} after {} seconds",
|
||||
x.addr, interval
|
||||
|
||||
@@ -148,8 +148,12 @@ impl HeaderSync {
|
||||
if now > *stalling_ts + Duration::seconds(120)
|
||||
&& header_head.total_difficulty < peer.info.total_difficulty()
|
||||
{
|
||||
self.peers
|
||||
.ban_peer(peer.info.addr, ReasonForBan::FraudHeight);
|
||||
if let Err(e) = self
|
||||
.peers
|
||||
.ban_peer(peer.info.addr, ReasonForBan::FraudHeight)
|
||||
{
|
||||
error!("failed to ban peer {}: {:?}", peer.info.addr, e);
|
||||
}
|
||||
info!(
|
||||
"sync: ban a fraud peer: {}, claimed height: {}, total difficulty: {}",
|
||||
peer.info.addr,
|
||||
|
||||
Reference in New Issue
Block a user