[refactor] TxOrphanage::HaveTx only by wtxid

This commit is contained in:
glozow
2024-05-10 10:55:39 +01:00
parent 7e475b9648
commit efcc593017
4 changed files with 11 additions and 16 deletions

View File

@@ -169,14 +169,10 @@ void TxOrphanage::AddChildrenToWorkSet(const CTransaction& tx)
}
}
bool TxOrphanage::HaveTx(const GenTxid& gtxid) const
bool TxOrphanage::HaveTx(const Wtxid& wtxid) const
{
LOCK(m_mutex);
if (gtxid.IsWtxid()) {
return m_wtxid_to_orphan_it.count(Wtxid::FromUint256(gtxid.GetHash()));
} else {
return m_orphans.count(Txid::FromUint256(gtxid.GetHash()));
}
return m_wtxid_to_orphan_it.count(wtxid);
}
CTransactionRef TxOrphanage::GetTxToReconsider(NodeId peer)