mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Merge 896649996b into merged_master (Bitcoin PR bitcoin/bitcoin#22915)
This commit is contained in:
commit
20e85cd2e1
13 changed files with 37 additions and 46 deletions
|
|
@ -1341,14 +1341,13 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||
// Load addresses from peers.dat
|
||||
uiInterface.InitMessage(_("Loading P2P addresses…").translated);
|
||||
int64_t nStart = GetTimeMillis();
|
||||
CAddrDB adb;
|
||||
if (adb.Read(*node.addrman)) {
|
||||
if (ReadPeerAddresses(args, *node.addrman)) {
|
||||
LogPrintf("Loaded %i addresses from peers.dat %dms\n", node.addrman->size(), GetTimeMillis() - nStart);
|
||||
} else {
|
||||
// Addrman can be in an inconsistent state after failure, reset it
|
||||
node.addrman = std::make_unique<CAddrMan>(asmap, /* deterministic */ false, /* consistency_check_ratio */ check_addrman);
|
||||
LogPrintf("Recreating peers.dat\n");
|
||||
adb.Write(*node.addrman);
|
||||
DumpPeerAddresses(args, *node.addrman);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue