|
|
@ -1455,9 +1455,7 @@ void DumpAddresses() |
|
|
|
void DumpData() |
|
|
|
void DumpData() |
|
|
|
{ |
|
|
|
{ |
|
|
|
DumpAddresses(); |
|
|
|
DumpAddresses(); |
|
|
|
|
|
|
|
DumpBanlist(); |
|
|
|
if (CNode::BannedSetIsDirty()) |
|
|
|
|
|
|
|
DumpBanlist(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void static ProcessOneShot() |
|
|
|
void static ProcessOneShot() |
|
|
@ -2474,22 +2472,26 @@ bool CBanDB::Read(banmap_t& banSet) |
|
|
|
// ... verify the network matches ours
|
|
|
|
// ... verify the network matches ours
|
|
|
|
if (memcmp(pchMsgTmp, Params().MessageStart(), sizeof(pchMsgTmp))) |
|
|
|
if (memcmp(pchMsgTmp, Params().MessageStart(), sizeof(pchMsgTmp))) |
|
|
|
return error("%s: Invalid network magic number", __func__); |
|
|
|
return error("%s: Invalid network magic number", __func__); |
|
|
|
|
|
|
|
|
|
|
|
// de-serialize address data into one CAddrMan object
|
|
|
|
// de-serialize address data into one CAddrMan object
|
|
|
|
ssBanlist >> banSet; |
|
|
|
ssBanlist >> banSet; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const std::exception& e) { |
|
|
|
catch (const std::exception& e) { |
|
|
|
return error("%s: Deserialize or I/O error - %s", __func__, e.what()); |
|
|
|
return error("%s: Deserialize or I/O error - %s", __func__, e.what()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void DumpBanlist() |
|
|
|
void DumpBanlist() |
|
|
|
{ |
|
|
|
{ |
|
|
|
int64_t nStart = GetTimeMillis(); |
|
|
|
|
|
|
|
CNode::SweepBanned(); // clean unused entries (if bantime has expired)
|
|
|
|
CNode::SweepBanned(); // clean unused entries (if bantime has expired)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!CNode::BannedSetIsDirty()) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int64_t nStart = GetTimeMillis(); |
|
|
|
|
|
|
|
|
|
|
|
CBanDB bandb; |
|
|
|
CBanDB bandb; |
|
|
|
banmap_t banmap; |
|
|
|
banmap_t banmap; |
|
|
|
CNode::GetBanned(banmap); |
|
|
|
CNode::GetBanned(banmap); |
|
|
|