diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2011-10-06 12:47:28 -0400 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2011-10-06 12:47:28 -0400 |
commit | 903a25583604b73e8b139c591b1e4a8a5402cbba (patch) | |
tree | 5f75ebd9a64fb4f0a437551cc92330ccbfa51640 | |
parent | 32ebde46123046d5dd41789b40578d2d43f1e7ef (diff) |
Bugfix: "bits" should be a hex-string, not a number (that just doesn't make sense)
-rw-r--r-- | src/bitcoinrpc.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index e9d8ca6a04..6e2eac5a7e 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -1773,7 +1773,14 @@ Value getmemorypool(const Array& params, bool fHelp) result.push_back(Pair("transactions", transactions)); result.push_back(Pair("coinbasevalue", (int64_t)pblock->vtx[0].vout[0].nValue)); result.push_back(Pair("time", (int64_t)pblock->nTime)); - result.push_back(Pair("bits", (int64_t)pblock->nBits)); + + union { + int32_t nBits; + char cBits[4]; + } uBits; + uBits.nBits = htonl((int32_t)pblock->nBits); + result.push_back(Pair("bits", HexStr(BEGIN(uBits.cBits), END(uBits.cBits)))); + return result; } else |