From 319643901283f6bfedebaafb76930f767f3fd703 Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Tue, 14 Mar 2017 11:15:22 -0400 Subject: [PATCH] return assetcommitment with listunspent --- src/wallet/rpcwallet.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index fd48085325..8d439aaf65 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2535,6 +2535,7 @@ UniValue listunspent(const UniValue& params, bool fHelp) " \"scriptPubKey\": \"key\", (string) the script key\n" " \"amount\": x.xxx, (numeric) the transaction amount in " + CURRENCY_UNIT + "\n" " \"asset\": \"hex\" (string) the asset id for this output\n" + " \"assetcommitment\": \"hex\" (string) the asset commitment for this output\n" " \"confirmations\": n, (numeric) The number of confirmations\n" " \"serValue\": \"hex\", (string) the output's value commitment\n" " \"blinder\": \"blind\" (string) The blinding factor used for a confidential output (or \"\")\n" @@ -2634,6 +2635,9 @@ UniValue listunspent(const UniValue& params, bool fHelp) entry.push_back(Pair("scriptPubKey", HexStr(scriptPubKey.begin(), scriptPubKey.end()))); entry.push_back(Pair("amount", ValueFromAmount(nValue))); entry.push_back(Pair("asset", assetid.GetHex())); + if (out.tx->vout[out.i].nAsset.IsCommitment()) { + entry.push_back(Pair("assetcommitment", HexStr(out.tx->vout[out.i].nAsset.vchCommitment))); + } entry.push_back(Pair("confirmations", out.nDepth)); entry.push_back(Pair("spendable", out.fSpendable)); entry.push_back(Pair("solvable", out.fSolvable));