mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-11 15:27:57 +00:00
Merge pull request #573 from luke-jr/bugfix_bits_string
Bugfix: getmemorypool "bits" should be a hex-string
This commit is contained in:
commit
4db9705dd8
@ -1773,7 +1773,14 @@ Value getmemorypool(const Array& params, bool fHelp)
|
|||||||
result.push_back(Pair("transactions", transactions));
|
result.push_back(Pair("transactions", transactions));
|
||||||
result.push_back(Pair("coinbasevalue", (int64_t)pblock->vtx[0].vout[0].nValue));
|
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("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;
|
return result;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user