Skip to content

Commit

Permalink
node: give bits in hex for rpc block methods
Browse files Browse the repository at this point in the history
  • Loading branch information
braydonf committed Dec 23, 2019
1 parent b9ad073 commit 5b3c39f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/node/rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2723,7 +2723,7 @@ class RPC extends RPCBase {
time: entry.time,
mediantime: mtp,
nonce: entry.nonce,
bits: entry.bits,
bits: hex32(entry.bits),
difficulty: toDifficulty(entry.bits),
chainwork: entry.chainwork.toString('hex', 64),
previousblockhash: !entry.prevBlock.equals(consensus.ZERO_HASH)
Expand Down Expand Up @@ -2767,7 +2767,7 @@ class RPC extends RPCBase {
time: entry.time,
mediantime: mtp,
nonce: entry.nonce,
bits: entry.bits,
bits: hex32(entry.bits),
difficulty: toDifficulty(entry.bits),
chainwork: entry.chainwork.toString('hex', 64),
nTx: txs.length,
Expand Down
1 change: 1 addition & 0 deletions test/node-rpc-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ describe('RPC', function() {

assert.deepEqual(chain.height, info.height);
assert.deepEqual(chain.tip, info.hash);
assert.equal(info.bits, '207fffff');
});

it('should return correct height', async () => {
Expand Down

0 comments on commit 5b3c39f

Please sign in to comment.