mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
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:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user