Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 2,193 Lines • ▼ Show 20 Lines | while (it != pfrom.vRecvGetData.end()) { | ||||
mempool.RemoveUnbroadcastTx(txid); | mempool.RemoveUnbroadcastTx(txid); | ||||
// As we're going to send tx, make sure its unconfirmed parents | // As we're going to send tx, make sure its unconfirmed parents | ||||
// are made requestable. | // are made requestable. | ||||
std::vector<TxId> parent_ids_to_add; | std::vector<TxId> parent_ids_to_add; | ||||
{ | { | ||||
LOCK(mempool.cs); | LOCK(mempool.cs); | ||||
auto txiter = mempool.GetIter(tx->GetId()); | auto txiter = mempool.GetIter(tx->GetId()); | ||||
if (txiter) { | if (txiter) { | ||||
const CTxMemPool::setEntries &parents = | const CTxMemPoolEntry::Parents &parents = | ||||
mempool.GetMemPoolParents(*txiter); | (*txiter)->GetMemPoolParentsConst(); | ||||
parent_ids_to_add.reserve(parents.size()); | parent_ids_to_add.reserve(parents.size()); | ||||
for (CTxMemPool::txiter parent_iter : parents) { | for (const CTxMemPoolEntry &parent : parents) { | ||||
if (parent_iter->GetTime() > | if (parent.GetTime() > | ||||
now - UNCONDITIONAL_RELAY_DELAY) { | now - UNCONDITIONAL_RELAY_DELAY) { | ||||
parent_ids_to_add.push_back( | parent_ids_to_add.push_back( | ||||
parent_iter->GetTx().GetId()); | parent.GetTx().GetId()); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
for (const TxId &parent_txid : parent_ids_to_add) { | for (const TxId &parent_txid : parent_ids_to_add) { | ||||
// Relaying a transaction with a recent but unconfirmed | // Relaying a transaction with a recent but unconfirmed | ||||
// parent. | // parent. | ||||
if (WITH_LOCK(pfrom.m_tx_relay->cs_tx_inventory, | if (WITH_LOCK(pfrom.m_tx_relay->cs_tx_inventory, | ||||
▲ Show 20 Lines • Show All 3,744 Lines • Show Last 20 Lines |