@@ -1321,7 +1321,7 @@ void PeerManager::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockInde
1321
1321
Peer& peer = *it.second ;
1322
1322
LOCK (peer.m_block_inv_mutex );
1323
1323
for (const uint256& hash : reverse_iterate (vHashes)) {
1324
- peer.vBlockHashesToAnnounce .push_back (hash);
1324
+ peer.m_blocks_for_headers_relay .push_back (hash);
1325
1325
}
1326
1326
}
1327
1327
}
@@ -2799,7 +2799,7 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat
2799
2799
LogPrint (BCLog::NET, " getblocks stopping, pruned or too old block at %d %s\n " , pindex->nHeight , pindex->GetBlockHash ().ToString ());
2800
2800
break ;
2801
2801
}
2802
- WITH_LOCK (peer->m_block_inv_mutex , peer->vInventoryBlockToSend .push_back (pindex->GetBlockHash ()));
2802
+ WITH_LOCK (peer->m_block_inv_mutex , peer->m_blocks_for_inv_relay .push_back (pindex->GetBlockHash ()));
2803
2803
if (--nLimit <= 0 )
2804
2804
{
2805
2805
// When this block is requested, we'll send an inv that'll
@@ -4225,8 +4225,8 @@ bool PeerManager::SendMessages(CNode* pto)
4225
4225
LOCK (peer->m_block_inv_mutex );
4226
4226
std::vector<CBlock> vHeaders;
4227
4227
bool fRevertToInv = ((!state.fPreferHeaders &&
4228
- (!state.fPreferHeaderAndIDs || peer->vBlockHashesToAnnounce .size () > 1 )) ||
4229
- peer->vBlockHashesToAnnounce .size () > MAX_BLOCKS_TO_ANNOUNCE);
4228
+ (!state.fPreferHeaderAndIDs || peer->m_blocks_for_headers_relay .size () > 1 )) ||
4229
+ peer->m_blocks_for_headers_relay .size () > MAX_BLOCKS_TO_ANNOUNCE);
4230
4230
const CBlockIndex *pBestIndex = nullptr ; // last header queued for delivery
4231
4231
ProcessBlockAvailability (pto->GetId ()); // ensure pindexBestKnownBlock is up-to-date
4232
4232
@@ -4235,7 +4235,7 @@ bool PeerManager::SendMessages(CNode* pto)
4235
4235
// Try to find first header that our peer doesn't have, and
4236
4236
// then send all headers past that one. If we come across any
4237
4237
// headers that aren't on ::ChainActive(), give up.
4238
- for (const uint256& hash : peer->vBlockHashesToAnnounce ) {
4238
+ for (const uint256& hash : peer->m_blocks_for_headers_relay ) {
4239
4239
const CBlockIndex* pindex = LookupBlockIndex (hash);
4240
4240
assert (pindex);
4241
4241
if (::ChainActive ()[pindex->nHeight ] != pindex) {
@@ -4252,7 +4252,7 @@ bool PeerManager::SendMessages(CNode* pto)
4252
4252
// which should be caught by the prior check), but one
4253
4253
// way this could happen is by using invalidateblock /
4254
4254
// reconsiderblock repeatedly on the tip, causing it to
4255
- // be added multiple times to vBlockHashesToAnnounce .
4255
+ // be added multiple times to m_blocks_for_headers_relay .
4256
4256
// Robustly deal with this rare situation by reverting
4257
4257
// to an inv.
4258
4258
fRevertToInv = true ;
@@ -4324,10 +4324,10 @@ bool PeerManager::SendMessages(CNode* pto)
4324
4324
}
4325
4325
if (fRevertToInv ) {
4326
4326
// If falling back to using an inv, just try to inv the tip.
4327
- // The last entry in vBlockHashesToAnnounce was our tip at some point
4327
+ // The last entry in m_blocks_for_headers_relay was our tip at some point
4328
4328
// in the past.
4329
- if (!peer->vBlockHashesToAnnounce .empty ()) {
4330
- const uint256& hashToAnnounce = peer->vBlockHashesToAnnounce .back ();
4329
+ if (!peer->m_blocks_for_headers_relay .empty ()) {
4330
+ const uint256& hashToAnnounce = peer->m_blocks_for_headers_relay .back ();
4331
4331
const CBlockIndex* pindex = LookupBlockIndex (hashToAnnounce);
4332
4332
assert (pindex);
4333
4333
@@ -4341,13 +4341,13 @@ bool PeerManager::SendMessages(CNode* pto)
4341
4341
4342
4342
// If the peer's chain has this block, don't inv it back.
4343
4343
if (!PeerHasHeader (&state, pindex)) {
4344
- peer->vInventoryBlockToSend .push_back (hashToAnnounce);
4344
+ peer->m_blocks_for_inv_relay .push_back (hashToAnnounce);
4345
4345
LogPrint (BCLog::NET, " %s: sending inv peer=%d hash=%s\n " , __func__,
4346
4346
pto->GetId (), hashToAnnounce.ToString ());
4347
4347
}
4348
4348
}
4349
4349
}
4350
- peer->vBlockHashesToAnnounce .clear ();
4350
+ peer->m_blocks_for_headers_relay .clear ();
4351
4351
}
4352
4352
4353
4353
//
@@ -4356,17 +4356,17 @@ bool PeerManager::SendMessages(CNode* pto)
4356
4356
std::vector<CInv> vInv;
4357
4357
{
4358
4358
LOCK (peer->m_block_inv_mutex );
4359
- vInv.reserve (std::max<size_t >(peer->vInventoryBlockToSend .size (), INVENTORY_BROADCAST_MAX));
4359
+ vInv.reserve (std::max<size_t >(peer->m_blocks_for_inv_relay .size (), INVENTORY_BROADCAST_MAX));
4360
4360
4361
4361
// Add blocks
4362
- for (const uint256& hash : peer->vInventoryBlockToSend ) {
4362
+ for (const uint256& hash : peer->m_blocks_for_inv_relay ) {
4363
4363
vInv.push_back (CInv (MSG_BLOCK, hash));
4364
4364
if (vInv.size () == MAX_INV_SZ) {
4365
4365
m_connman.PushMessage (pto, msgMaker.Make (NetMsgType::INV, vInv));
4366
4366
vInv.clear ();
4367
4367
}
4368
4368
}
4369
- peer->vInventoryBlockToSend .clear ();
4369
+ peer->m_blocks_for_inv_relay .clear ();
4370
4370
4371
4371
if (pto->m_tx_relay != nullptr ) {
4372
4372
LOCK (pto->m_tx_relay ->cs_tx_inventory );
0 commit comments