diff options
| author | Wladimir J. van der Laan <[email protected]> | 2017-05-02 17:09:25 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2017-05-02 18:41:58 +0200 |
| commit | faf2dea5ea811196ac2291d5369dd0b3621989a6 (patch) | |
| tree | f6419688769c11c8ce016ef82ca389c5efecc30b /src/net.cpp | |
| parent | Merge #10093: [Qt] Don't add arguments of sensitive command to console window (diff) | |
| parent | [tests] update disconnect_ban.py test case to work with listbanned (diff) | |
| download | discoin-faf2dea5ea811196ac2291d5369dd0b3621989a6.tar.xz discoin-faf2dea5ea811196ac2291d5369dd0b3621989a6.zip | |
Merge #10234: [net] listbanned RPC and QT should show correct banned subnets
d6732d8 [tests] update disconnect_ban.py test case to work with listbanned (John Newbery)
77c54b2 [net] listbanned RPC and QT should show correct banned subnets (John Newbery)
Tree-SHA512: edd0e43377d456260d2697213c2829f8483630f3a668b6707d52605faefa610d951d10e6f22a95eff483cbd14faa8ac9b69fa7d3c0b5735c5f3df23fd71282e0
Diffstat (limited to 'src/net.cpp')
| -rw-r--r-- | src/net.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/net.cpp b/src/net.cpp index 50b192e2c..ed4c75260 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -418,10 +418,10 @@ void CConnman::DumpBanlist() CBanDB bandb; banmap_t banmap; - SetBannedSetDirty(false); GetBanned(banmap); - if (!bandb.Write(banmap)) - SetBannedSetDirty(true); + if (bandb.Write(banmap)) { + SetBannedSetDirty(false); + } LogPrint(BCLog::NET, "Flushed %d banned node ips/subnets to banlist.dat %dms\n", banmap.size(), GetTimeMillis() - nStart); @@ -541,6 +541,8 @@ bool CConnman::Unban(const CSubNet &subNet) { void CConnman::GetBanned(banmap_t &banMap) { LOCK(cs_setBanned); + // Sweep the banlist so expired bans are not returned + SweepBanned(); banMap = setBanned; //create a thread safe copy } |