Bug fixes

This commit is contained in:
joshuayabut 2016-11-20 00:38:01 -05:00
parent 4762891823
commit c23f01990e
1 changed files with 2 additions and 1 deletions

View File

@ -31,7 +31,8 @@ exports.createGeneration = function(blockHeight, reward, recipients, poolAddress
} else {
var blockHeightSerial = '0' + blockHeight.toString(16);
}
length = '0' + ((blockHeightSerial.length / 2) + 0);
var height = Math.ceil((blockHeight >>> 0).toString(2).length / 8);
length = '0' + height;
var serializedBlockHeight = Buffer.concat([
new Buffer(length, 'hex'),
util.reverseBuffer(Buffer(blockHeightSerial, 'hex')),