From c80c242738135c4c3b13b1caaac66277c4f5000d Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 26 Feb 2017 03:24:48 -0800 Subject: [PATCH] rpc: reverse target endianness. --- lib/http/rpc.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/http/rpc.js b/lib/http/rpc.js index 58938ef2..2b0b51b3 100644 --- a/lib/http/rpc.js +++ b/lib/http/rpc.js @@ -1678,9 +1678,7 @@ RPC.prototype.__template = co(function* _template(version, coinbase, rules) { vbrequired: 0, height: attempt.height, previousblockhash: util.revHex(block.prevBlock), - // NOTE: The BIP says this is supposed - // to be big-endian, which is _incorrect_. - target: attempt.target.toString('hex'), + target: util.revHex(attempt.target.toString('hex')), bits: util.hex32(block.bits), noncerange: '00000000ffffffff', curtime: block.ts,