Skip to content

Commit

Permalink
banman: Add, use CBanEntry ctor that takes ban reason
Browse files Browse the repository at this point in the history
  • Loading branch information
dongcarl committed Jan 16, 2019
1 parent 1ffa4ce commit c2e04d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/addrdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ class CBanEntry
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;

template <typename Stream, typename Operation>
Expand Down
3 changes: 1 addition & 2 deletions src/banman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
CBanEntry banEntry(GetTime());
banEntry.banReason = banReason;
CBanEntry banEntry(GetTime(), banReason);

int64_t normalized_bantimeoffset = bantimeoffset;
bool normalized_sinceUnixEpoch = sinceUnixEpoch;
Expand Down

0 comments on commit c2e04d3

Please sign in to comment.