Bypass headers anti-DoS checks for NoBan peers

This commit is contained in:
Suhas Daftuar
2022-08-30 12:45:21 -04:00
parent 132ed7eaaa
commit e5982ecdc4
2 changed files with 33 additions and 6 deletions

View File

@@ -2820,6 +2820,13 @@ void PeerManagerImpl::ProcessHeadersMessage(CNode& pfrom, Peer& peer,
}
}
// If our peer has NetPermissionFlags::NoBan privileges, then bypass our
// anti-DoS logic (this saves bandwidth when we connect to a trusted peer
// on startup).
if (pfrom.HasPermission(NetPermissionFlags::NoBan)) {
already_validated_work = true;
}
// At this point, the headers connect to something in our block index.
// Do anti-DoS checks to determine if we should process or store for later
// processing.