Skip to content

Commit

Permalink
fix: wrong ban reason (#4461)
Browse files Browse the repository at this point in the history
Description
---
Change wrong ban.

Motivation and Context
---
#4449
  • Loading branch information
Cifko committed Aug 16, 2022
1 parent 4d0968d commit 4788789
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -174,7 +174,7 @@ impl<'a, B: BlockchainBackend + 'static> HeaderSynchronizer<'a, B> {
},
Err(ref err @ BlockHeaderSyncError::PeerSentInaccurateChainMetadata { claimed, actual, local }) => {
warn!(target: LOG_TARGET, "{}", err);
self.ban_peer_long(node_id, BanReason::PeerCouldNotProvideStrongerChain {
self.ban_peer_long(node_id, BanReason::PeerSentInaccurateChainMetadata {
claimed,
actual: actual.unwrap_or(0),
local,
Expand Down Expand Up @@ -822,6 +822,11 @@ enum BanReason {
actual: String,
expected: String,
},
#[error(
"Peer sent inaccurate chain metadata. Claimed {claimed} but validated difficulty was {actual}, while local \
was {local}"
)]
PeerSentInaccurateChainMetadata { claimed: u128, actual: u128, local: u128 },
}

struct ChainSplitInfo {
Expand Down

0 comments on commit 4788789

Please sign in to comment.