Add confirmations to z_listreceivedbyaddress

This commit is contained in:
Jonathan "Duke" Leto 2019-01-06 09:46:22 -08:00 committed by Alfredo Garcia
parent f859ae0067
commit 3a5235050b
1 changed files with 3 additions and 0 deletions

View File

@ -3321,6 +3321,7 @@ UniValue z_listreceivedbyaddress(const UniValue& params, bool fHelp)
" \"txid\": \"txid\", (string) the transaction id\n"
" \"amount\": xxxxx, (numeric) the amount of value in the note\n"
" \"memo\": xxxxx, (string) hexadecimal string representation of memo field\n"
" \"confirmations\" : n, (numeric) the number of confirmations\n"
" \"jsindex\" (sprout) : n, (numeric) the joinsplit index\n"
" \"jsoutindex\" (sprout) : n, (numeric) the output index of the joinsplit\n"
" \"outindex\" (sapling) : n, (numeric) the output index\n"
@ -3374,6 +3375,7 @@ UniValue z_listreceivedbyaddress(const UniValue& params, bool fHelp)
obj.push_back(Pair("memo", HexStr(data)));
obj.push_back(Pair("jsindex", entry.jsop.js));
obj.push_back(Pair("jsoutindex", entry.jsop.n));
obj.push_back(Pair("confirmations", entry.confirmations));
if (hasSpendingKey) {
obj.push_back(Pair("change", pwalletMain->IsNoteSproutChange(nullifierSet, entry.address, entry.jsop)));
}
@ -3386,6 +3388,7 @@ UniValue z_listreceivedbyaddress(const UniValue& params, bool fHelp)
obj.push_back(Pair("amount", ValueFromAmount(CAmount(entry.note.value()))));
obj.push_back(Pair("memo", HexStr(entry.memo)));
obj.push_back(Pair("outindex", (int)entry.op.n));
obj.push_back(Pair("confirmations", entry.confirmations));
if (hasSpendingKey) {
obj.push_back(Pair("change", pwalletMain->IsNoteSaplingChange(nullifierSet, entry.address, entry.op)));
}