p2p: reconsider orphans when missing inputs are mined

This commit is contained in:
Greg Sanders
2026-08-16 06:45:37 -04:00
parent c90c23d388
commit 9cc7dc50bd
3 changed files with 31 additions and 0 deletions

View File

@@ -100,6 +100,9 @@ void TxDownloadManagerImpl::BlockConnected(const std::shared_ptr<const CBlock>&
m_orphanage->EraseForBlock(*pblock);
for (const auto& ptx : pblock->vtx) {
// Reconsider potential child transactions.
m_orphanage->AddChildrenToWorkSet(*ptx, m_opts.m_rng);
RecentConfirmedTransactionsFilter().insert(ptx->GetHash().ToUint256());
if (ptx->HasWitness()) {
RecentConfirmedTransactionsFilter().insert(ptx->GetWitnessHash().ToUint256());

View File

@@ -531,6 +531,8 @@ void TxOrphanageImpl::LimitOrphans()
std::vector<std::pair<Wtxid, NodeId>> TxOrphanageImpl::AddChildrenToWorkSet(const CTransaction& tx, FastRandomContext& rng)
{
if (m_orphans.empty()) return {};
std::vector<std::pair<Wtxid, NodeId>> ret;
auto& index_by_wtxid = m_orphans.get<ByWtxid>();
for (unsigned int i = 0; i < tx.vout.size(); i++) {