diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2017-09-11 15:25:37 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2017-09-11 15:33:20 -0700 |
commit | b9bceaf1c081a84d9fcc680372614e797b168a9e (patch) | |
tree | 0291156c20ed7d8f36700ae300556c87196874bb | |
parent | 1afc22a7667a7a5c66b4b5d7f50832356dd5ec12 (diff) | |
parent | b86a42077a134888c53bfd406b87bf0a39c78264 (diff) | |
download | bitcoin-b9bceaf1c081a84d9fcc680372614e797b168a9e.tar.xz |
Merge #11252: [P2P] When clearing addrman clear mapInfo and mapAddr.
b86a42077 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
-rw-r--r-- | src/addrman.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/addrman.h b/src/addrman.h index 547088aedf..18f3062287 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -472,6 +472,8 @@ public: nTried = 0; nNew = 0; nLastGood = 1; //Initially at 1 so that "never" is strictly worse. + mapInfo.clear(); + mapAddr.clear(); } CAddrMan() |