Fix Block to allow regtest target (easiest possible target)

This commit is contained in:
junderw 2018-12-12 21:07:16 +09:00
parent f57a73496d
commit 7c0e02ad48
No known key found for this signature in database
GPG key ID: B256185D3A971908
2 changed files with 5 additions and 1 deletions

View file

@ -145,7 +145,7 @@ Block.calculateTarget = function (bits) {
const exponent = ((bits & 0xff000000) >> 24) - 3
const mantissa = bits & 0x007fffff
const target = Buffer.alloc(32, 0)
target.writeUInt32BE(mantissa, 28 - exponent)
target.writeUIntBE(mantissa, 29 - exponent, 3)
return target
}