|
|
@ -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(); |
|
|
|