diff options
author | Pieter Wuille <pieter@wuille.net> | 2020-10-12 15:35:08 -0700 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2020-10-12 15:35:08 -0700 |
commit | 886be97af5d4aba338b23a7b20b8560be8156231 (patch) | |
tree | ccc1c69bdee6c79b398c1e031e81d48a2b54a89a /src/netaddress.h | |
parent | 883cea7dea3cedc9b45b6191f7d4e7be2d9a11ca (diff) |
Ignore incorrectly-serialized banlist.dat entries
Diffstat (limited to 'src/netaddress.h')
-rw-r--r-- | src/netaddress.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/netaddress.h b/src/netaddress.h index aea0875511..803b00481e 100644 --- a/src/netaddress.h +++ b/src/netaddress.h @@ -451,6 +451,8 @@ class CSubNet /// Is this value valid? (only used to signal parse errors) bool valid; + bool SanityCheck() const; + public: CSubNet(); CSubNet(const CNetAddr& addr, uint8_t mask); @@ -482,6 +484,8 @@ class CSubNet READWRITE(obj.netmask); } READWRITE(obj.valid); + // Mark invalid if the result doesn't pass sanity checking. + SER_READ(obj, if (obj.valid) obj.valid = obj.SanityCheck()); } }; |