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.

Delete(nId);
            }
        }
    }
    return fInsert;
}
bool AddrManImpl::Good_(const CService& addr, bool test_before_evict, int64_t nTime)
{
    AssertLockHeld(cs);
    int nId;
    nLastGood = nTime;
    AddrInfo* pinfo = Find(addr, &nId);
    
    if (!pinfo) return false;
    AddrInfo& info = *pinfo;
    
    info.nLastSuccess = nTime;
    info.nLastTry = nTime;
    info.nAttempts = 0;
    
    
    
    if (info.fInTried) return false;
    
    if (!Assume(info.nRefCount > 0)) return false;
    
    int tried_bucket = info.GetTriedBucket(nKey, m_asmap);
    int tried_bucket_pos = info.GetBucketPosition(nKey, false, tried_bucket);
    
    if (test_before_evict && (vvTried[tried_bucket][tried_bucket_pos] != -1)) {