diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 06dc0ded2..28c987fb1 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3682,7 +3682,7 @@ UniValue z_anonsetblockdelta(const UniValue& params, bool fHelp, const CPubKey& if (nHeight < 0 || nHeight > chainActive.Height()) { throw JSONRPCError(RPC_INVALID_PARAMETER, "Block height out of range"); } - strHash = chainActive[nHeight]->GetBlockHash().GetHex(); + auto strHash = chainActive[nHeight]->GetBlockHash().GetHex(); uint256 hash(uint256S(strHash)); if (mapBlockIndex.count(hash) == 0) @@ -3729,9 +3729,9 @@ UniValue z_anonsettxdelta(const UniValue& params, bool fHelp, const CPubKey& myp uint256 txid; txid.SetHex(params[0].get_str()); - if (!pwalletMain->mapWallet.count(hash)) + if (!pwalletMain->mapWallet.count(txid)) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid or non-wallet transaction id!"); - const CWalletTx& wtx = pwalletMain->mapWallet[hash]; + const CWalletTx& wtx = pwalletMain->mapWallet[txid]; // delta = shielded outputs - shielded inputs int delta = wtx.vShieldedSpend.size() - wtx.vShieldedOutput.size();