From 46e53abe9cdc75aee8b5b94af699cf0a67b32744 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Fri, 13 Jan 2017 15:11:35 -0800 Subject: [PATCH] gbt: fix target endianness. --- lib/http/rpc.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/http/rpc.js b/lib/http/rpc.js index 03d9ee2a..194dfddc 100644 --- a/lib/http/rpc.js +++ b/lib/http/rpc.js @@ -1674,7 +1674,9 @@ RPC.prototype.__template = co(function* _template(version, coinbase, rules) { vbrequired: 0, height: attempt.height, previousblockhash: util.revHex(block.prevBlock), - target: util.revHex(attempt.target.toString('hex')), + // NOTE: The BIP says this is supposed + // to be big-endian, which is _incorrect_. + target: attempt.target.toString('hex'), bits: util.hex32(block.bits), noncerange: '00000000ffffffff', curtime: block.ts,