diff --git a/src/net.h b/src/net.h --- a/src/net.h +++ b/src/net.h @@ -748,7 +748,7 @@ // List of block ids we still have announce. There is no final sorting // before sending, as they are always sent immediately and in the order // requested. - std::vector vInventoryBlockToSend GUARDED_BY(cs_inventory); + std::vector vInventoryBlockToSend GUARDED_BY(cs_inventory); RecursiveMutex cs_inventory; int64_t nNextInvSend{0}; // Used for headers announcements - unfiltered blocks to relay. @@ -870,7 +870,8 @@ setInventoryTxToSend.insert(txid); } } else if (inv.type == MSG_BLOCK) { - vInventoryBlockToSend.push_back(inv.hash); + const BlockHash hash(inv.hash); + vInventoryBlockToSend.push_back(hash); } } diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -4508,7 +4508,7 @@ config.GetMaxBlockSize() / 1000000)); // Add blocks - for (const uint256 &hash : pto->vInventoryBlockToSend) { + for (const BlockHash &hash : pto->vInventoryBlockToSend) { vInv.push_back(CInv(MSG_BLOCK, hash)); if (vInv.size() == MAX_INV_SZ) { connman->PushMessage(pto, msgMaker.Make(NetMsgType::INV, vInv));