refactor: Convert mini_miner from uint256 to Txid

This commit is contained in:
marcofleon
2025-07-29 15:32:57 +01:00
parent 326f244724
commit aeb0f78330
5 changed files with 20 additions and 31 deletions

View File

@@ -983,13 +983,13 @@ CTxMemPool::setEntries CTxMemPool::GetIterSet(const std::set<Txid>& hashes) cons
return ret;
}
std::vector<CTxMemPool::txiter> CTxMemPool::GetIterVec(const std::vector<uint256>& txids) const
std::vector<CTxMemPool::txiter> CTxMemPool::GetIterVec(const std::vector<Txid>& txids) const
{
AssertLockHeld(cs);
std::vector<txiter> ret;
ret.reserve(txids.size());
for (const auto& txid : txids) {
const auto it{GetIter(Txid::FromUint256(txid))};
const auto it{GetIter(txid)};
if (!it) return {};
ret.push_back(*it);
}
@@ -1227,7 +1227,7 @@ void CTxMemPool::SetLoadTried(bool load_tried)
m_load_tried = load_tried;
}
std::vector<CTxMemPool::txiter> CTxMemPool::GatherClusters(const std::vector<uint256>& txids) const
std::vector<CTxMemPool::txiter> CTxMemPool::GatherClusters(const std::vector<Txid>& txids) const
{
AssertLockHeld(cs);
std::vector<txiter> clustered_txs{GetIterVec(txids)};