aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2020-01-29 13:55:40 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2020-01-31 14:51:37 -0800
commitd58bcdc4b569a667b6974c3547b7ff6f665afce9 (patch)
tree3ddcf6f9514819e53de8d197d4af798b55c7085c /src
parent7fcaa8291c6e155e6f5fba42e2ee8ec0bee046a3 (diff)
Avoid asmap copies in initialization
Diffstat (limited to 'src')
-rw-r--r--src/init.cpp2
-rw-r--r--src/net.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 49f4727169..8720133b85 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -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");
diff --git a/src/net.h b/src/net.h
index f23cae323e..92f7799e97 100644
--- a/src/net.h
+++ b/src/net.h
@@ -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 {