refactor: make CTxMemPool::GetIter strongly typed

This allows adding a GetIter(const Wtxid&) overload in a next
commit, making it easier to visit this function from a variant.

Co-authored-by: stickies-v <stickies-v@protonmail.com>
This commit is contained in:
marcofleon
2025-06-23 14:52:13 +01:00
parent 11d28f21bb
commit fcf92fd640
4 changed files with 10 additions and 10 deletions

View File

@@ -523,12 +523,12 @@ static RPCHelpMan getmempooldescendants()
if (!request.params[1].isNull())
fVerbose = request.params[1].get_bool();
uint256 hash = ParseHashV(request.params[0], "parameter 1");
Txid txid{Txid::FromUint256(ParseHashV(request.params[0], "parameter 1"))};
const CTxMemPool& mempool = EnsureAnyMemPool(request.context);
LOCK(mempool.cs);
const auto it{mempool.GetIter(hash)};
const auto it{mempool.GetIter(txid)};
if (!it) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Transaction not in mempool");
}