mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
Replace GenTxid with Txid/Wtxid overloads in txmempool
Co-authored-by: stickies-v <stickies-v@protonmail.com>
This commit is contained in:
@@ -886,24 +886,6 @@ CTransactionRef CTxMemPool::get(const uint256& hash) const
|
||||
return i->GetSharedTx();
|
||||
}
|
||||
|
||||
TxMempoolInfo CTxMemPool::info(const GenTxid& gtxid) const
|
||||
{
|
||||
LOCK(cs);
|
||||
auto i = (gtxid.IsWtxid() ? GetIter(Wtxid::FromUint256(gtxid.GetHash())) : GetIter(Txid::FromUint256(gtxid.GetHash())));
|
||||
return i.has_value() ? GetInfo(*i) : TxMempoolInfo{};
|
||||
}
|
||||
|
||||
TxMempoolInfo CTxMemPool::info_for_relay(const GenTxid& gtxid, uint64_t last_sequence) const
|
||||
{
|
||||
LOCK(cs);
|
||||
auto i = (gtxid.IsWtxid() ? GetIter(Wtxid::FromUint256(gtxid.GetHash())) : GetIter(Txid::FromUint256(gtxid.GetHash())));
|
||||
if (i.has_value() && (*i)->GetSequence() < last_sequence) {
|
||||
return GetInfo(*i);
|
||||
} else {
|
||||
return TxMempoolInfo();
|
||||
}
|
||||
}
|
||||
|
||||
void CTxMemPool::PrioritiseTransaction(const uint256& hash, const CAmount& nFeeDelta)
|
||||
{
|
||||
{
|
||||
@@ -1018,7 +1000,7 @@ std::vector<CTxMemPool::txiter> CTxMemPool::GetIterVec(const std::vector<uint256
|
||||
bool CTxMemPool::HasNoInputsOf(const CTransaction &tx) const
|
||||
{
|
||||
for (unsigned int i = 0; i < tx.vin.size(); i++)
|
||||
if (exists(GenTxid::Txid(tx.vin[i].prevout.hash)))
|
||||
if (exists(tx.vin[i].prevout.hash))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -1188,7 +1170,7 @@ void CTxMemPool::TrimToSize(size_t sizelimit, std::vector<COutPoint>* pvNoSpends
|
||||
if (pvNoSpendsRemaining) {
|
||||
for (const CTransaction& tx : txn) {
|
||||
for (const CTxIn& txin : tx.vin) {
|
||||
if (exists(GenTxid::Txid(txin.prevout.hash))) continue;
|
||||
if (exists(txin.prevout.hash)) continue;
|
||||
pvNoSpendsRemaining->push_back(txin.prevout);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user