|
|
@ -19,21 +19,15 @@ class CDataStream;
|
|
|
|
class CBanEntry
|
|
|
|
class CBanEntry
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
static const int CURRENT_VERSION=1;
|
|
|
|
static constexpr int CURRENT_VERSION{1};
|
|
|
|
int nVersion;
|
|
|
|
int nVersion{CBanEntry::CURRENT_VERSION};
|
|
|
|
int64_t nCreateTime;
|
|
|
|
int64_t nCreateTime{0};
|
|
|
|
int64_t nBanUntil;
|
|
|
|
int64_t nBanUntil{0};
|
|
|
|
|
|
|
|
|
|
|
|
CBanEntry()
|
|
|
|
CBanEntry() {}
|
|
|
|
{
|
|
|
|
|
|
|
|
SetNull();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
explicit CBanEntry(int64_t nCreateTimeIn)
|
|
|
|
explicit CBanEntry(int64_t nCreateTimeIn)
|
|
|
|
{
|
|
|
|
: nCreateTime{nCreateTimeIn} {}
|
|
|
|
SetNull();
|
|
|
|
|
|
|
|
nCreateTime = nCreateTimeIn;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Create a ban entry from JSON.
|
|
|
|
* Create a ban entry from JSON.
|
|
|
@ -42,13 +36,6 @@ public:
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
explicit CBanEntry(const UniValue& json);
|
|
|
|
explicit CBanEntry(const UniValue& json);
|
|
|
|
|
|
|
|
|
|
|
|
void SetNull()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
nVersion = CBanEntry::CURRENT_VERSION;
|
|
|
|
|
|
|
|
nCreateTime = 0;
|
|
|
|
|
|
|
|
nBanUntil = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Generate a JSON representation of this ban entry.
|
|
|
|
* Generate a JSON representation of this ban entry.
|
|
|
|
* @return JSON suitable for passing to the `CBanEntry(const UniValue&)` constructor.
|
|
|
|
* @return JSON suitable for passing to the `CBanEntry(const UniValue&)` constructor.
|
|
|
|