0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-02 09:46:52 -05:00

Avoid asmap copies in initialization

This commit is contained in:
Pieter Wuille 2020-01-29 13:55:40 -08:00
parent 7fcaa8291c
commit d58bcdc4b5
2 changed files with 2 additions and 2 deletions

View file

@ -1832,8 +1832,8 @@ bool AppInitMain(NodeContext& node)
InitError(strprintf(_("Could not find or parse specified asmap: '%s'").translated, asmap_path));
return false;
}
node.connman->SetAsmap(asmap);
const uint256 asmap_version = SerializeHash(asmap);
node.connman->SetAsmap(std::move(asmap));
LogPrintf("Using asmap version %s for IP bucketing.\n", asmap_version.ToString());
} else {
LogPrintf("Using /16 prefix for IP bucketing.\n");

View file

@ -331,7 +331,7 @@ public:
*/
int64_t PoissonNextSendInbound(int64_t now, int average_interval_seconds);
void SetAsmap(std::vector<bool> asmap) { addrman.m_asmap = asmap; }
void SetAsmap(std::vector<bool> asmap) { addrman.m_asmap = std::move(asmap); }
private:
struct ListenSocket {