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.

if (!newOnly &&
       (nTried > 0 && (nNew == 0 || insecure_rand.randbool() == 0))) {
        
        double fChanceFactor = 1.0;
        while (1) {
            
            int nKBucket = insecure_rand.randrange(ADDRMAN_TRIED_BUCKET_COUNT);
            int nKBucketPos = insecure_rand.randrange(ADDRMAN_BUCKET_SIZE);
            
            
            int i;
            for (i = 0; i < ADDRMAN_BUCKET_SIZE; ++i) {
                if (vvTried[nKBucket][(nKBucketPos + i) % ADDRMAN_BUCKET_SIZE] != -1) break;
            }
            
            if (i == ADDRMAN_BUCKET_SIZE) continue;
            
            int nId = vvTried[nKBucket][(nKBucketPos + i) % ADDRMAN_BUCKET_SIZE];
            const auto it_found{mapInfo.find(nId)};
            assert(it_found != mapInfo.end());
            const AddrInfo& info{it_found->second};
            
            if (insecure_rand.randbits(30) < fChanceFactor * info.GetChance() * (1 << 30)) {
                LogPrint(BCLog::ADDRMAN, "Selected %s from tried\n", info.ToString());
                return {info, info.nLastTry};
            }
            
            fChanceFactor *= 1.2;
        }
    } else {