@@ -2359,7 +2359,7 @@ void PeerManagerImpl::ProcessGetBlockData(CNode& pfrom, Peer& peer, const CInv&
2359
2359
// and we want it right after the last block so they don't
2360
2360
// wait for other stuff first.
2361
2361
std::vector<CInv> vInv;
2362
- vInv.push_back ( CInv ( MSG_BLOCK, m_chainman.ActiveChain ().Tip ()->GetBlockHash () ));
2362
+ vInv.emplace_back ( MSG_BLOCK, m_chainman.ActiveChain ().Tip ()->GetBlockHash ());
2363
2363
m_connman.PushMessage (&pfrom, msgMaker.Make (NetMsgType::INV, vInv));
2364
2364
peer.m_continuation_block .SetNull ();
2365
2365
}
@@ -2761,7 +2761,7 @@ void PeerManagerImpl::HeadersDirectFetchBlocks(CNode& pfrom, const Peer& peer, c
2761
2761
break ;
2762
2762
}
2763
2763
uint32_t nFetchFlags = GetFetchFlags (peer);
2764
- vGetData.push_back ( CInv ( MSG_BLOCK | nFetchFlags, pindex->GetBlockHash () ));
2764
+ vGetData.emplace_back ( MSG_BLOCK | nFetchFlags, pindex->GetBlockHash ());
2765
2765
BlockRequested (pfrom.GetId (), *pindex);
2766
2766
LogPrint (BCLog::NET, " Requesting block %s from peer=%d\n " ,
2767
2767
pindex->GetBlockHash ().ToString (), pfrom.GetId ());
@@ -3299,7 +3299,7 @@ void PeerManagerImpl::ProcessCompactBlockTxns(CNode& pfrom, Peer& peer, const Bl
3299
3299
if (first_in_flight) {
3300
3300
// Might have collided, fall back to getdata now :(
3301
3301
std::vector<CInv> invs;
3302
- invs.push_back ( CInv ( MSG_BLOCK | GetFetchFlags (peer), block_transactions.blockhash ) );
3302
+ invs.emplace_back ( MSG_BLOCK | GetFetchFlags (peer), block_transactions.blockhash );
3303
3303
m_connman.PushMessage (&pfrom, msgMaker.Make (NetMsgType::GETDATA, invs));
3304
3304
} else {
3305
3305
RemoveBlockRequest (block_transactions.blockhash , pfrom.GetId ());
@@ -4149,7 +4149,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4149
4149
LogPrint (BCLog::NET, " getheaders %d to %s from peer=%d\n " , (pindex ? pindex->nHeight : -1 ), hashStop.IsNull () ? " end" : hashStop.ToString (), pfrom.GetId ());
4150
4150
for (; pindex; pindex = m_chainman.ActiveChain ().Next (pindex))
4151
4151
{
4152
- vHeaders.push_back (pindex->GetBlockHeader ());
4152
+ vHeaders.emplace_back (pindex->GetBlockHeader ());
4153
4153
if (--nLimit <= 0 || pindex->GetBlockHash () == hashStop)
4154
4154
break ;
4155
4155
}
@@ -5649,14 +5649,14 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
5649
5649
pBestIndex = pindex;
5650
5650
if (fFoundStartingHeader ) {
5651
5651
// add this to the headers message
5652
- vHeaders.push_back (pindex->GetBlockHeader ());
5652
+ vHeaders.emplace_back (pindex->GetBlockHeader ());
5653
5653
} else if (PeerHasHeader (&state, pindex)) {
5654
5654
continue ; // keep looking for the first new block
5655
5655
} else if (pindex->pprev == nullptr || PeerHasHeader (&state, pindex->pprev )) {
5656
5656
// Peer doesn't have this header but they do have the prior one.
5657
5657
// Start sending headers.
5658
5658
fFoundStartingHeader = true ;
5659
- vHeaders.push_back (pindex->GetBlockHeader ());
5659
+ vHeaders.emplace_back (pindex->GetBlockHeader ());
5660
5660
} else {
5661
5661
// Peer doesn't have this header or the prior one -- nothing will
5662
5662
// connect, so bail out.
@@ -5742,7 +5742,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
5742
5742
5743
5743
// Add blocks
5744
5744
for (const uint256& hash : peer->m_blocks_for_inv_relay ) {
5745
- vInv.push_back ( CInv ( MSG_BLOCK, hash) );
5745
+ vInv.emplace_back ( MSG_BLOCK, hash);
5746
5746
if (vInv.size () == MAX_INV_SZ) {
5747
5747
m_connman.PushMessage (pto, msgMaker.Make (NetMsgType::INV, vInv));
5748
5748
vInv.clear ();
@@ -5948,7 +5948,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
5948
5948
}
5949
5949
for (const CBlockIndex *pindex : vToDownload) {
5950
5950
uint32_t nFetchFlags = GetFetchFlags (*peer);
5951
- vGetData.push_back ( CInv ( MSG_BLOCK | nFetchFlags, pindex->GetBlockHash () ));
5951
+ vGetData.emplace_back ( MSG_BLOCK | nFetchFlags, pindex->GetBlockHash ());
5952
5952
BlockRequested (pto->GetId (), *pindex);
5953
5953
LogPrint (BCLog::NET, " Requesting block %s (%d) peer=%d\n " , pindex->GetBlockHash ().ToString (),
5954
5954
pindex->nHeight , pto->GetId ());
0 commit comments