mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-19 12:10:19 +01:00
[net] listbanned RPC and QT should show correct banned subnets
Github-Pull: #10234
Rebased-From: 77c54b270d
This commit is contained in:
committed by
Luke Dashjr
parent
04226938a3
commit
d289b564e3
@@ -413,10 +413,10 @@ void CConnman::DumpBanlist()
|
|||||||
|
|
||||||
CBanDB bandb;
|
CBanDB bandb;
|
||||||
banmap_t banmap;
|
banmap_t banmap;
|
||||||
SetBannedSetDirty(false);
|
|
||||||
GetBanned(banmap);
|
GetBanned(banmap);
|
||||||
if (!bandb.Write(banmap))
|
if (bandb.Write(banmap)) {
|
||||||
SetBannedSetDirty(true);
|
SetBannedSetDirty(false);
|
||||||
|
}
|
||||||
|
|
||||||
LogPrint("net", "Flushed %d banned node ips/subnets to banlist.dat %dms\n",
|
LogPrint("net", "Flushed %d banned node ips/subnets to banlist.dat %dms\n",
|
||||||
banmap.size(), GetTimeMillis() - nStart);
|
banmap.size(), GetTimeMillis() - nStart);
|
||||||
@@ -536,6 +536,8 @@ bool CConnman::Unban(const CSubNet &subNet) {
|
|||||||
void CConnman::GetBanned(banmap_t &banMap)
|
void CConnman::GetBanned(banmap_t &banMap)
|
||||||
{
|
{
|
||||||
LOCK(cs_setBanned);
|
LOCK(cs_setBanned);
|
||||||
|
// Sweep the banlist so expired bans are not returned
|
||||||
|
SweepBanned();
|
||||||
banMap = setBanned; //create a thread safe copy
|
banMap = setBanned; //create a thread safe copy
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user