diff options
Diffstat (limited to 'src/rpcblockchain.cpp')
| -rw-r--r-- | src/rpcblockchain.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 5554f039a..11af1abf5 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, @@ -170,10 +172,13 @@ Value gettxoutsetinfo(const Array& params, bool fHelp) CCoinsStats stats; if (pcoinsTip->GetStats(stats)) { - ret.push_back(Pair("bestblock", pcoinsTip->GetBestBlock()->GetBlockHash().GetHex())); + ret.push_back(Pair("height", (boost::int64_t)stats.nHeight)); + ret.push_back(Pair("bestblock", stats.hashBlock.GetHex())); ret.push_back(Pair("transactions", (boost::int64_t)stats.nTransactions)); ret.push_back(Pair("txouts", (boost::int64_t)stats.nTransactionOutputs)); ret.push_back(Pair("bytes_serialized", (boost::int64_t)stats.nSerializedSize)); + ret.push_back(Pair("hash_serialized", stats.hashSerialized.GetHex())); + ret.push_back(Pair("total_amount", ValueFromAmount(stats.nTotalAmount))); } return ret; } @@ -213,10 +218,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)); |