mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 13:03:17 +01:00
Merge #11616: Update ban-state in case of dirty-state during periodic sweep
57ac471
Call BannedListChanged outside of cs_setBanned lock (Jonas Schnelli)c853812
Update ban-state in case of dirty-state during periodic sweep (Jonas Schnelli) Pull request description: We do currently not update the UI during periodic ban list sweeps (via dump banlist). Fixes #11612 Tree-SHA512: bffbdcc03c63042177bdd511b0a9187c211c2b5011178481e8ee3e43a71eef1e4cd6b72f73672babab142b644f62f8b56f0aac1d26d3f19372b1f8644fec9395
This commit is contained in:
commit
8585bb8f05
@ -603,7 +603,8 @@ void CConnman::SetBanned(const banmap_t &banMap)
|
|||||||
void CConnman::SweepBanned()
|
void CConnman::SweepBanned()
|
||||||
{
|
{
|
||||||
int64_t now = GetTime();
|
int64_t now = GetTime();
|
||||||
|
bool notifyUI = false;
|
||||||
|
{
|
||||||
LOCK(cs_setBanned);
|
LOCK(cs_setBanned);
|
||||||
banmap_t::iterator it = setBanned.begin();
|
banmap_t::iterator it = setBanned.begin();
|
||||||
while(it != setBanned.end())
|
while(it != setBanned.end())
|
||||||
@ -614,11 +615,17 @@ void CConnman::SweepBanned()
|
|||||||
{
|
{
|
||||||
setBanned.erase(it++);
|
setBanned.erase(it++);
|
||||||
setBannedIsDirty = true;
|
setBannedIsDirty = true;
|
||||||
|
notifyUI = true;
|
||||||
LogPrint(BCLog::NET, "%s: Removed banned node ip/subnet from banlist.dat: %s\n", __func__, subNet.ToString());
|
LogPrint(BCLog::NET, "%s: Removed banned node ip/subnet from banlist.dat: %s\n", __func__, subNet.ToString());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// update UI
|
||||||
|
if(notifyUI && clientInterface) {
|
||||||
|
clientInterface->BannedListChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CConnman::BannedSetIsDirty()
|
bool CConnman::BannedSetIsDirty()
|
||||||
|
Loading…
Reference in New Issue
Block a user