banman: Add, use CBanEntry ctor that takes ban reason
This commit is contained in:
parent
1ffa4ce27d
commit
c2e04d37f3
2 changed files with 6 additions and 2 deletions
|
@ -43,6 +43,11 @@ public:
|
||||||
nCreateTime = nCreateTimeIn;
|
nCreateTime = nCreateTimeIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
explicit CBanEntry(int64_t n_create_time_in, BanReason ban_reason_in) : CBanEntry(n_create_time_in)
|
||||||
|
{
|
||||||
|
banReason = ban_reason_in;
|
||||||
|
}
|
||||||
|
|
||||||
ADD_SERIALIZE_METHODS;
|
ADD_SERIALIZE_METHODS;
|
||||||
|
|
||||||
template <typename Stream, typename Operation>
|
template <typename Stream, typename Operation>
|
||||||
|
|
|
@ -102,8 +102,7 @@ void BanMan::Ban(const CNetAddr& netAddr, const BanReason& banReason, int64_t ba
|
||||||
|
|
||||||
void BanMan::Ban(const CSubNet& subNet, const BanReason& banReason, int64_t bantimeoffset, bool sinceUnixEpoch)
|
void BanMan::Ban(const CSubNet& subNet, const BanReason& banReason, int64_t bantimeoffset, bool sinceUnixEpoch)
|
||||||
{
|
{
|
||||||
CBanEntry banEntry(GetTime());
|
CBanEntry banEntry(GetTime(), banReason);
|
||||||
banEntry.banReason = banReason;
|
|
||||||
|
|
||||||
int64_t normalized_bantimeoffset = bantimeoffset;
|
int64_t normalized_bantimeoffset = bantimeoffset;
|
||||||
bool normalized_sinceUnixEpoch = sinceUnixEpoch;
|
bool normalized_sinceUnixEpoch = sinceUnixEpoch;
|
||||||
|
|
Loading…
Add table
Reference in a new issue