block: use writeUInt32BE for target calculation

This commit is contained in:
Daniel Cousens 2017-03-28 20:26:59 +11:00 committed by Daniel Cousens
parent d89bd58346
commit 29316a2fbc
2 changed files with 3 additions and 7 deletions

View file

@ -135,12 +135,7 @@ Block.calculateTarget = function (bits) {
var target = new Buffer(32)
target.fill(0)
target[i] = mantissa & 0xff
target[i - 1] = mantissa >> 8
target[i - 2] = mantissa >> 16
target[i - 3] = mantissa >> 24
target.writeUInt32BE(mantissa, i - 3)
return target
}