mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-31 16:24:48 +02:00
refactor: Convert remaining instances from uint256 to Txid
These remaining miscellaneous changes were identified by commenting out the `operator const uint256&` conversion and the `Compare(const uint256&)` method from `transaction_identifier.h`.
This commit is contained in:
@@ -98,7 +98,7 @@ static void ApplyHash(T& hash_obj, const Txid& hash, const std::map<uint32_t, Co
|
||||
}
|
||||
}
|
||||
|
||||
static void ApplyStats(CCoinsStats& stats, const uint256& hash, const std::map<uint32_t, Coin>& outputs)
|
||||
static void ApplyStats(CCoinsStats& stats, const std::map<uint32_t, Coin>& outputs)
|
||||
{
|
||||
assert(!outputs.empty());
|
||||
stats.nTransactions++;
|
||||
@@ -126,7 +126,7 @@ static bool ComputeUTXOStats(CCoinsView* view, CCoinsStats& stats, T hash_obj, c
|
||||
Coin coin;
|
||||
if (pcursor->GetKey(key) && pcursor->GetValue(coin)) {
|
||||
if (!outputs.empty() && key.hash != prevkey) {
|
||||
ApplyStats(stats, prevkey, outputs);
|
||||
ApplyStats(stats, outputs);
|
||||
ApplyHash(hash_obj, prevkey, outputs);
|
||||
outputs.clear();
|
||||
}
|
||||
@@ -140,7 +140,7 @@ static bool ComputeUTXOStats(CCoinsView* view, CCoinsStats& stats, T hash_obj, c
|
||||
pcursor->Next();
|
||||
}
|
||||
if (!outputs.empty()) {
|
||||
ApplyStats(stats, prevkey, outputs);
|
||||
ApplyStats(stats, outputs);
|
||||
ApplyHash(hash_obj, prevkey, outputs);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ private:
|
||||
const size_t m_max_mem_usage;
|
||||
std::list<CTransactionRef> queuedTx;
|
||||
using TxList = decltype(queuedTx);
|
||||
std::unordered_map<uint256, TxList::iterator, SaltedTxidHasher> iters_by_txid;
|
||||
std::unordered_map<Txid, TxList::iterator, SaltedTxidHasher> iters_by_txid;
|
||||
|
||||
/** Trim the earliest-added entries until we are within memory bounds. */
|
||||
std::vector<CTransactionRef> LimitMemoryUsage();
|
||||
|
||||
Reference in New Issue
Block a user