aboutsummaryrefslogtreecommitdiff
path: root/src/addrdb.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/addrdb.h')
-rw-r--r--src/addrdb.h33
1 files changed, 6 insertions, 27 deletions
diff --git a/src/addrdb.h b/src/addrdb.h
index 1e0ccb1f60..26400ee0b6 100644
--- a/src/addrdb.h
+++ b/src/addrdb.h
@@ -8,10 +8,8 @@
#include <fs.h>
#include <net_types.h> // For banmap_t
-#include <serialize.h>
#include <univalue.h>
-#include <string>
#include <vector>
class CAddress;
@@ -21,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.
@@ -44,19 +36,6 @@ public:
*/
explicit CBanEntry(const UniValue& json);
- SERIALIZE_METHODS(CBanEntry, obj)
- {
- uint8_t ban_reason = 2; //! For backward compatibility
- READWRITE(obj.nVersion, obj.nCreateTime, obj.nBanUntil, ban_reason);
- }
-
- 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.