Skip to content

Commit b9bceaf

Browse files
committed
Merge #11252: [P2P] When clearing addrman clear mapInfo and mapAddr.
b86a420 when clearing addrman clear mapInfo and mapAddr (Gregory Sanders) Pull request description: Power failure on my machine resulted in a corrupted addrman that would hit bad assertions when trying to serialize the "cleared" addrman to disk: https://github.com/bitcoin/bitcoin/blob/6866b4912b8013ed748d12250209f7079a3c92e6/src/addrman.h#L320 Tree-SHA512: 07ca8b6cbd88407e5f3f0dccb346ae31bd1392f4210b2d5c5647c853986bfec95cf70240b92bafdc61b90e452a5d8315962738d10c10c2b53fdabff10503d05a
2 parents 1afc22a + b86a420 commit b9bceaf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/addrman.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,8 @@ class CAddrMan
472472
nTried = 0;
473473
nNew = 0;
474474
nLastGood = 1; //Initially at 1 so that "never" is strictly worse.
475+
mapInfo.clear();
476+
mapAddr.clear();
475477
}
476478

477479
CAddrMan()

0 commit comments

Comments
 (0)