Skip to content

Commit

Permalink
Merge pull request ElementsProject#57 from instagibbs/txoutval
Browse files Browse the repository at this point in the history
gettxout: return 'valuecommitment' if value blinded
  • Loading branch information
instagibbs authored Mar 1, 2017
2 parents 591fd7e + eee3121 commit e66732b
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 e66732b

Please sign in to comment.