Avoid asmap copies in initialization
This commit is contained in:
1 parent
7fcaa8291c
commit
d58bcdc4b5
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -1832,8 +1832,8 @@ bool AppInitMain(NodeContext& node)
|
|||||||
InitError(strprintf(_("Could not find or parse specified asmap: '%s'").translated, asmap_path));
|
InitError(strprintf(_("Could not find or parse specified asmap: '%s'").translated, asmap_path));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
node.connman->SetAsmap(asmap);
|
|
||||||
const uint256 asmap_version = SerializeHash(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());
|
LogPrintf("Using asmap version %s for IP bucketing.\n", asmap_version.ToString());
|
||||||
} else {
|
} else {
|
||||||
LogPrintf("Using /16 prefix for IP bucketing.\n");
|
LogPrintf("Using /16 prefix for IP bucketing.\n");
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
int64_t PoissonNextSendInbound(int64_t now, int average_interval_seconds);
|
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:
|
private:
|
||||||
struct ListenSocket {
|
struct ListenSocket {
|
||||||
|
|||||||
Reference in new issue
Block a user