Skip to content

Commit fa3bd9d

Browse files
author
MarcoFalke
committed
Remove CBanEntry::SetNull
1 parent fab53ff commit fa3bd9d

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

src/addrdb.h

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,15 @@ class CDataStream;
1919
class CBanEntry
2020
{
2121
public:
22-
static const int CURRENT_VERSION=1;
23-
int nVersion;
24-
int64_t nCreateTime;
25-
int64_t nBanUntil;
22+
static constexpr int CURRENT_VERSION{1};
23+
int nVersion{CBanEntry::CURRENT_VERSION};
24+
int64_t nCreateTime{0};
25+
int64_t nBanUntil{0};
2626

27-
CBanEntry()
28-
{
29-
SetNull();
30-
}
27+
CBanEntry() {}
3128

3229
explicit CBanEntry(int64_t nCreateTimeIn)
33-
{
34-
SetNull();
35-
nCreateTime = nCreateTimeIn;
36-
}
30+
: nCreateTime{nCreateTimeIn} {}
3731

3832
/**
3933
* Create a ban entry from JSON.
@@ -42,13 +36,6 @@ class CBanEntry
4236
*/
4337
explicit CBanEntry(const UniValue& json);
4438

45-
void SetNull()
46-
{
47-
nVersion = CBanEntry::CURRENT_VERSION;
48-
nCreateTime = 0;
49-
nBanUntil = 0;
50-
}
51-
5239
/**
5340
* Generate a JSON representation of this ban entry.
5441
* @return JSON suitable for passing to the `CBanEntry(const UniValue&)` constructor.

0 commit comments

Comments
 (0)