mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
addrman: remove invalid addresses when unserializing
The Tor v2 addresses, left over from when Tor v2 was supported will be unserialized as a dummy, invalid `::` (all zeros) IPv6 address. Remove them so that they do not take up space in addrman.
This commit is contained in:
@@ -448,6 +448,8 @@ public:
|
||||
LogPrint(BCLog::ADDRMAN, "addrman lost %i new and %i tried addresses due to collisions\n", nLostUnk, nLost);
|
||||
}
|
||||
|
||||
RemoveInvalid();
|
||||
|
||||
Check();
|
||||
}
|
||||
|
||||
@@ -756,6 +758,9 @@ private:
|
||||
//! Update an entry's service bits.
|
||||
void SetServices_(const CService &addr, ServiceFlags nServices) EXCLUSIVE_LOCKS_REQUIRED(cs);
|
||||
|
||||
//! Remove invalid addresses.
|
||||
void RemoveInvalid() EXCLUSIVE_LOCKS_REQUIRED(cs);
|
||||
|
||||
friend class CAddrManTest;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user