aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-01-17 18:42:57 -0800
committerGavin Andresen <gavinandresen@gmail.com>2013-01-17 18:42:57 -0800
commit2c7847349d5d4b1f3e8480c5137c2e8f3e2a5f5c (patch)
tree73f2b26ee30e7ee89c871ac415d0967fc0ebe4c5 /src
parent0e31ae9818528d52bbd802a8917b7015f8e38ae7 (diff)
parent4e68391a7f3b3361584af032bf671bd9dc0677fe (diff)
Merge pull request #2149 from sipa/fixtxoutrpc
Make output of gettxout RPC more consistent
Diffstat (limited to 'src')
-rw-r--r--src/rpcblockchain.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp
index 5554f039a7..2200679050 100644
--- a/src/rpcblockchain.cpp
+++ b/src/rpcblockchain.cpp
@@ -9,6 +9,8 @@
using namespace json_spirit;
using namespace std;
+void ScriptPubKeyToJSON(const CScript& scriptPubKey, Object& out);
+
double GetDifficulty(const CBlockIndex* blockindex)
{
// Floating point number that is a multiple of the minimum difficulty,
@@ -213,10 +215,9 @@ Value gettxout(const Array& params, bool fHelp)
ret.push_back(Pair("confirmations", 0));
else
ret.push_back(Pair("confirmations", pcoinsTip->GetBestBlock()->nHeight - coins.nHeight + 1));
- ret.push_back(Pair("amount", (boost::int64_t)coins.vout[n].nValue));
+ ret.push_back(Pair("value", ValueFromAmount(coins.vout[n].nValue)));
Object o;
- o.push_back(Pair("asm", coins.vout[n].scriptPubKey.ToString()));
- o.push_back(Pair("hex", HexStr(coins.vout[n].scriptPubKey.begin(), coins.vout[n].scriptPubKey.end())));
+ ScriptPubKeyToJSON(coins.vout[n].scriptPubKey, o);
ret.push_back(Pair("scriptPubKey", o));
ret.push_back(Pair("version", coins.nVersion));
ret.push_back(Pair("coinbase", coins.fCoinBase));