Skip to content

Commit

Permalink
gettxout: return 'valuecommitment' if value blinded
Browse files Browse the repository at this point in the history
  • Loading branch information
instagibbs committed Mar 1, 2017
1 parent 4b7b649 commit eee3121
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,9 +763,11 @@ UniValue gettxout(const UniValue& params, bool fHelp)
ret.push_back(Pair("confirmations", 0));
else
ret.push_back(Pair("confirmations", pindex->nHeight - coins.nHeight + 1));
if (coins.vout[n].nValue.IsAmount())
if (coins.vout[n].nValue.IsAmount()) {
ret.push_back(Pair("value", ValueFromAmount(coins.vout[n].nValue.GetAmount())));
else {} // TODO: Non-Amount values
} else {
ret.push_back(Pair("valuecommitment", uint256(coins.vout[n].nValue.vchCommitment).GetHex()));
}
UniValue o(UniValue::VOBJ);
ScriptPubKeyToJSON(coins.vout[n].scriptPubKey, o, true);
ret.push_back(Pair("scriptPubKey", o));
Expand Down

0 comments on commit eee3121

Please sign in to comment.