diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-08-31 18:31:03 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-08-31 18:30:11 +0200 |
commit | fa3bd9de99ee2bdfce2010e9367391a146e41878 (patch) | |
tree | 49d8e9dc56b940a12f2d42bd0c932d9eb40a6f8e | |
parent | fab53ff1e5a995f40a110d6f9e1214f263908b46 (diff) |
Remove CBanEntry::SetNull
-rw-r--r-- | src/addrdb.h | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/addrdb.h b/src/addrdb.h index 567b9973b7..26400ee0b6 100644 --- a/src/addrdb.h +++ b/src/addrdb.h @@ -19,21 +19,15 @@ class CDataStream; class CBanEntry { public: - static const int CURRENT_VERSION=1; - int nVersion; - int64_t nCreateTime; - int64_t nBanUntil; + static constexpr int CURRENT_VERSION{1}; + int nVersion{CBanEntry::CURRENT_VERSION}; + int64_t nCreateTime{0}; + int64_t nBanUntil{0}; - CBanEntry() - { - SetNull(); - } + CBanEntry() {} explicit CBanEntry(int64_t nCreateTimeIn) - { - SetNull(); - nCreateTime = nCreateTimeIn; - } + : nCreateTime{nCreateTimeIn} {} /** * Create a ban entry from JSON. @@ -42,13 +36,6 @@ public: */ explicit CBanEntry(const UniValue& json); - void SetNull() - { - nVersion = CBanEntry::CURRENT_VERSION; - nCreateTime = 0; - nBanUntil = 0; - } - /** * Generate a JSON representation of this ban entry. * @return JSON suitable for passing to the `CBanEntry(const UniValue&)` constructor. |