aboutsummaryrefslogtreecommitdiff
path: root/src/addrman.cpp
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2020-04-02 18:18:08 -0700
committerPieter Wuille <[email protected]>2020-04-08 16:26:06 -0700
commitfffd8dca2de39ad4a683f0dce57cdca55ed2f600 (patch)
treee86de83adca4ce10b1a46c8f25aa8d4f2bc8f522 /src/addrman.cpp
parentImprove asmap Interpret checks and document failures (diff)
downloaddiscoin-fffd8dca2de39ad4a683f0dce57cdca55ed2f600.tar.xz
discoin-fffd8dca2de39ad4a683f0dce57cdca55ed2f600.zip
Add asmap sanity checker
Diffstat (limited to 'src/addrman.cpp')
-rw-r--r--src/addrman.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/addrman.cpp b/src/addrman.cpp
index 2f8a3a0bd..b22ad6d64 100644
--- a/src/addrman.cpp
+++ b/src/addrman.cpp
@@ -644,5 +644,9 @@ std::vector<bool> CAddrMan::DecodeAsmap(fs::path path)
bits.push_back((cur_byte >> bit) & 1);
}
}
+ if (!SanityCheckASMap(bits)) {
+ LogPrintf("Sanity check of asmap file %s failed\n", path);
+ return {};
+ }
return bits;
}