diff options
| author | Gavin Andresen <[email protected]> | 2011-10-09 10:32:22 -0700 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2011-10-09 10:32:22 -0700 |
| commit | 4db9705dd839cbb386398b1eb4be2a67357c27c4 (patch) | |
| tree | f230357ca3e0e359bb5c7ed3dd4dfb107c73a427 /src | |
| parent | Merge pull request #575 from globalcitizen/master (diff) | |
| parent | Bugfix: "bits" should be a hex-string, not a number (that just doesn't make s... (diff) | |
| download | discoin-4db9705dd839cbb386398b1eb4be2a67357c27c4.tar.xz discoin-4db9705dd839cbb386398b1eb4be2a67357c27c4.zip | |
Merge pull request #573 from luke-jr/bugfix_bits_string
Bugfix: getmemorypool "bits" should be a hex-string
Diffstat (limited to 'src')
| -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 e9d8ca6a0..6e2eac5a7 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 |