Skip to main content

Module peer_scoring

Module peer_scoring 

Source
Expand description

Peer Misbehavior & Ban Score Tracking

Implements Bitcoin Core’s peer scoring system (see net_processing.cpp Misbehaving()). Every protocol violation adds to a peer’s “ban score”. Once the score reaches or exceeds the ban threshold (default 100), the peer is disconnected and its address is banned for a configurable duration.

§Violation Categories

ViolationScore
Invalid block header100
Invalid block (consensus failure)100
Invalid transaction10
Unexpected message during handshake10
Too many addr messages20
Invalid network message20
DoS (too many messages, etc.)50
Unconnectable block10

Structs§

BanEntry
A banned address entry.
PeerScoring
Manages per-peer ban scores and a ban list.

Enums§

Misbehavior
Categories of protocol violations with associated ban scores.
ScoreAction
Actions the caller should take after recording misbehavior.