Skip to content

Commit e55a089

Browse files
committed
[RPC] Add nullifiers to listshieldedunspent output
1 parent 8b04db1 commit e55a089

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ UniValue listshieldedunspent(const JSONRPCRequest& request)
552552
" \"amount\": xxxxx, (numeric) the amount of value in the note\n"
553553
" \"memo\": xxxxx, (string) hexademical string representation of memo field\n"
554554
" \"change\": true|false, (boolean) true if the address that received the note is also one of the sending addresses\n"
555+
" \"nullifier\": xxxxx, (string) the note's nullifier, hex encoded"
555556
" }\n"
556557
" ,...\n"
557558
"]\n"
@@ -639,6 +640,10 @@ UniValue listshieldedunspent(const JSONRPCRequest& request)
639640
if (hasSaplingSpendingKey) {
640641
obj.pushKV("change", pwalletMain->GetSaplingScriptPubKeyMan()->IsNoteSaplingChange(nullifierSet, entry.address, entry.op));
641642
}
643+
const auto& nd = pwalletMain->mapWallet.at(entry.op.hash).mapSaplingNoteData.at(entry.op);
644+
if (nd.nullifier) {
645+
obj.pushKV("nullifier", nd.nullifier->ToString());
646+
}
642647
results.push_back(obj);
643648
}
644649
}

0 commit comments

Comments
 (0)