HomePhabricator

addrman: detect on-disk corrupted nNew and nTried during unserialization

Description

addrman: detect on-disk corrupted nNew and nTried during unserialization

Summary:

Negative `nNew` or `nTried` are not possible during normal operation.
So, if we read such values during unserialize, report addrman corruption.

Backport of core#22455.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D12276

Details

Provenance
Vasil Dimov <vd@FreeBSD.org>Authored on Jul 15 2021, 11:04
FabienCommitted on Oct 17 2022, 15:29
FabienPushed on Oct 17 2022, 15:29
Reviewer
Restricted Project
Differential Revision
D12276: addrman: detect on-disk corrupted nNew and nTried during unserialization
Parents
rABCc36b96ee5735: [addrman] Merge the two Add() functions
Branches
Unknown
Tags
Unknown