Add asmap sanity checker

This commit is contained in:
Pieter Wuille
2020-04-02 18:18:08 -07:00
parent 5feefbe6e7
commit fffd8dca2d
5 changed files with 70 additions and 0 deletions

View File

@@ -894,3 +894,8 @@ bool operator<(const CSubNet& a, const CSubNet& b)
{
return (a.network < b.network || (a.network == b.network && memcmp(a.netmask, b.netmask, 16) < 0));
}
bool SanityCheckASMap(const std::vector<bool>& asmap)
{
return SanityCheckASMap(asmap, 128); // For IP address lookups, the input is 128 bits
}