@@ -2799,7 +2799,7 @@ void PeerManagerImpl::ProcessGetBlockData(CNode& pfrom, Peer& peer, const CInv&
27992799 // and we want it right after the last block so they don't
28002800 // wait for other stuff first.
28012801 std::vector<CInv> vInv;
2802- vInv.push_back ( CInv ( MSG_BLOCK, m_chainman.ActiveChain ().Tip ()->GetBlockHash () ));
2802+ vInv.emplace_back ( MSG_BLOCK, m_chainman.ActiveChain ().Tip ()->GetBlockHash ());
28032803 m_connman.PushMessage (&pfrom, msgMaker.Make (NetMsgType::INV, vInv));
28042804 peer.m_continuation_block .SetNull ();
28052805 }
@@ -3199,7 +3199,7 @@ void PeerManagerImpl::HeadersDirectFetchBlocks(CNode& pfrom, const Peer& peer, c
31993199 // Can't download any more from this peer
32003200 break ;
32013201 }
3202- vGetData.push_back ( CInv ( MSG_BLOCK, pindex->GetBlockHash () ));
3202+ vGetData.emplace_back ( MSG_BLOCK, pindex->GetBlockHash ());
32033203 BlockRequested (pfrom.GetId (), *pindex);
32043204 LogPrint (BCLog::NET, " Requesting block %s from peer=%d\n " ,
32053205 pindex->GetBlockHash ().ToString (), pfrom.GetId ());
@@ -4616,7 +4616,7 @@ void PeerManagerImpl::ProcessMessage(
46164616 const auto send_headers = [this /* for m_connman */ , &hashStop, &pindex, &nodestate, &pfrom, &msgMaker](auto msg_type_internal, auto & v_headers, auto callback) {
46174617 int nLimit = GetHeadersLimit (pfrom, msg_type_internal == NetMsgType::HEADERS2);
46184618 for (; pindex; pindex = m_chainman.ActiveChain ().Next (pindex)) {
4619- v_headers.push_back (callback (pindex));
4619+ v_headers.emplace_back (callback (pindex));
46204620
46214621 if (--nLimit <= 0 || pindex->GetBlockHash () == hashStop)
46224622 break ;
@@ -6167,14 +6167,14 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
61676167 }
61686168 if (fFoundStartingHeader ) {
61696169 // add this to the headers message
6170- vHeaders.push_back (pindex->GetBlockHeader ());
6170+ vHeaders.emplace_back (pindex->GetBlockHeader ());
61716171 } else if (PeerHasHeader (&state, pindex)) {
61726172 continue ; // keep looking for the first new block
61736173 } else if (pindex->pprev == nullptr || PeerHasHeader (&state, pindex->pprev ) || isPrevDevnetGenesisBlock) {
61746174 // Peer doesn't have this header but they do have the prior one.
61756175 // Start sending headers.
61766176 fFoundStartingHeader = true ;
6177- vHeaders.push_back (pindex->GetBlockHeader ());
6177+ vHeaders.emplace_back (pindex->GetBlockHeader ());
61786178 } else {
61796179 // Peer doesn't have this header or the prior one -- nothing will
61806180 // connect, so bail out.
@@ -6282,7 +6282,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
62826282
62836283 // Add blocks
62846284 for (const uint256& hash : peer->m_blocks_for_inv_relay ) {
6285- vInv.push_back ( CInv ( MSG_BLOCK, hash) );
6285+ vInv.emplace_back ( MSG_BLOCK, hash);
62866286 if (vInv.size () == MAX_INV_SZ) {
62876287 m_connman.PushMessage (pto, msgMaker.Make (NetMsgType::INV, vInv));
62886288 vInv.clear ();
@@ -6527,7 +6527,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
65276527 NodeId staller = -1 ;
65286528 FindNextBlocksToDownload (*peer, MAX_BLOCKS_IN_TRANSIT_PER_PEER - state.nBlocksInFlight , vToDownload, staller);
65296529 for (const CBlockIndex *pindex : vToDownload) {
6530- vGetData.push_back ( CInv ( MSG_BLOCK, pindex->GetBlockHash () ));
6530+ vGetData.emplace_back ( MSG_BLOCK, pindex->GetBlockHash ());
65316531 BlockRequested (pto->GetId (), *pindex);
65326532 LogPrint (BCLog::NET, " Requesting block %s (%d) peer=%d\n " , pindex->GetBlockHash ().ToString (),
65336533 pindex->nHeight , pto->GetId ());
0 commit comments