IPv6 addresses include a range that can map IPv4 addresses,
which allowed those mapped addresses to bypass filtering.
This filter should be replaced by AS filtering at some point.
defined as those who don't relay blocks for now.
Using transactions would be much faster, but more error prone,
as well as exploit prone.
The score can be reused later to store in the peer list to
affect selection probability.
Cycling is meant to opportunistically connecting to a new peer
in case we're connected to a malicious subset of the network.
We now prefer dropping a low score peer, since those will be
either ones which already failed newly at least one test, or
newly connected ones at the same height. In particular, they
can't be a newly connected one that's found another chain, or
they'd be in synchronizing state, not normal state.
{
MINFO(context << "Peer " << context.m_connection_id << " relayed the block we were waiting on");
context.m_score += 1;
if (context.m_score > 10) // prevent a node from being all nice for a while then switching to asshole
Switch back to 5, 10 makes it less aggressive
#define LAST_ACTIVITY_STALL_THRESHOLD (2.0f) // seconds
#define WAIT_FOR_BLOCK_TIME (20) // seconds
#define DROP_PEERS_ON_SCORE -1
#define DROP_PEERS_ON_SCORE -1
Double define
d301c8db15
tocee2587645
4 years ago