diff options
Diffstat (limited to 'src/addrman.h')
-rw-r--r-- | src/addrman.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/addrman.h b/src/addrman.h index 665e253192..2a5c6c06b4 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -450,6 +450,10 @@ public: LogPrint(BCLog::ADDRMAN, "addrman lost %i new and %i tried addresses due to collisions\n", nLostUnk, nLost); } + RemoveInvalid(); + + ResetI2PPorts(); + Check(); } @@ -762,6 +766,17 @@ 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); + + /** + * Reset the ports of I2P peers to 0. + * This is needed as a temporary measure because now we enforce port 0 and + * only connect to I2P hosts if the port is 0, but in the early days some + * I2P addresses with port 8333 were rumoured and persisted into addrmans. + */ + void ResetI2PPorts() EXCLUSIVE_LOCKS_REQUIRED(cs); + friend class CAddrManTest; }; |