diff options
-rw-r--r-- | src/banman.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/banman.cpp b/src/banman.cpp index dc16aab282..19c8e37523 100644 --- a/src/banman.cpp +++ b/src/banman.cpp @@ -104,11 +104,14 @@ void BanMan::Ban(const CSubNet& subNet, const BanReason& banReason, int64_t bant { CBanEntry banEntry(GetTime()); banEntry.banReason = banReason; + + int64_t normalized_bantimeoffset = bantimeoffset; + bool normalized_sinceUnixEpoch = sinceUnixEpoch; if (bantimeoffset <= 0) { - bantimeoffset = m_default_ban_time; - sinceUnixEpoch = false; + normalized_bantimeoffset = m_default_ban_time; + normalized_sinceUnixEpoch = false; } - banEntry.nBanUntil = (sinceUnixEpoch ? 0 : GetTime()) + bantimeoffset; + banEntry.nBanUntil = (normalized_sinceUnixEpoch ? 0 : GetTime()) + normalized_bantimeoffset; { LOCK(m_cs_banned); |