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.

#include <addrman.h>
#include <addrman_impl.h>
#include <hash.h>
#include <logging.h>
#include <logging/timer.h>
#include <netaddress.h>
#include <protocol.h>
#include <random.h>
#include <serialize.h>
#include <streams.h>
#include <timedata.h>
#include <tinyformat.h>
#include <uint256.h>
#include <util/check.h>
#include <cmath>
#include <optional>
static constexpr uint32_t ADDRMAN_TRIED_BUCKETS_PER_GROUP{8};
static constexpr uint32_t ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP{64};
static constexpr int32_t ADDRMAN_NEW_BUCKETS_PER_ADDRESS{8};
static constexpr int64_t ADDRMAN_HORIZON_DAYS{30};
static constexpr int32_t ADDRMAN_RETRIES{3};
static constexpr int32_t ADDRMAN_MAX_FAILURES{10};
static constexpr int64_t ADDRMAN_MIN_FAIL_DAYS{7};
static constexpr int64_t ADDRMAN_REPLACEMENT_HOURS{4};
static constexpr size_t ADDRMAN_SET_TRIED_COLLISION_SIZE{10};
static constexpr int64_t ADDRMAN_TEST_WINDOW{40*60}; 
int AddrInfo::GetTriedBucket(const uint256& nKey, const std::vector<bool>& asmap) const