See https://github.com/bitcoin/bitcoin/pull/22762#issuecomment-951063826

This can be fixed by creating a new exception type and catching it in the right place.

#### Useful skills:

* C++ exceptions
* Addrman serialization
* Functional tests

#### Want to work on this issue?

For guidance on contributing, please read [CONTRIBUTING.md](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md) before opening your pull request.

{
    AssertLockHeld(cs);
    if (!addr.IsRoutable())
        return false;
    int nId;
    AddrInfo* pinfo = Find(addr, &nId);
    
    if (addr == source) {
        nTimePenalty = 0;
    }
    if (pinfo) {
        
        bool fCurrentlyOnline = (GetAdjustedTime() - addr.nTime < 24 * 60 * 60);
        int64_t nUpdateInterval = (fCurrentlyOnline ? 60 * 60 : 24 * 60 * 60);
        if (addr.nTime && (!pinfo->nTime || pinfo->nTime < addr.nTime - nUpdateInterval - nTimePenalty))
            pinfo->nTime = std::max((int64_t)0, addr.nTime - nTimePenalty);
        
        pinfo->nServices = ServiceFlags(pinfo->nServices | addr.nServices);
        
        if (!addr.nTime || (pinfo->nTime && addr.nTime <= pinfo->nTime))
            return false;
        
        if (pinfo->fInTried)
            return false;
        
        if (pinfo->nRefCount == ADDRMAN_NEW_BUCKETS_PER_ADDRESS)
            return false;