refactor: Make node_id a const& in RemoveBlockRequest

This works around a valgrind false-positive.
This commit is contained in:
MarcoFalke 2024-11-13 09:36:20 +01:00
parent 9a8e5adb16
commit fa1622db20
No known key found for this signature in database

View file

@ -1155,7 +1155,7 @@ void PeerManagerImpl::RemoveBlockRequest(const uint256& hash, std::optional<Node
Assume(mapBlocksInFlight.count(hash) <= MAX_CMPCTBLOCKS_INFLIGHT_PER_BLOCK); Assume(mapBlocksInFlight.count(hash) <= MAX_CMPCTBLOCKS_INFLIGHT_PER_BLOCK);
while (range.first != range.second) { while (range.first != range.second) {
auto [node_id, list_it] = range.first->second; const auto& [node_id, list_it]{range.first->second};
if (from_peer && *from_peer != node_id) { if (from_peer && *from_peer != node_id) {
range.first++; range.first++;