template: minor.
This commit is contained in:
parent
945fa381c5
commit
1b098b61ba
@ -75,7 +75,6 @@ CPUMiner.prototype._init = function _init() {
|
||||
});
|
||||
|
||||
this.on('status', function(stat) {
|
||||
// Send progress report.
|
||||
self.logger.info(
|
||||
'CPUMiner: hashrate=%dkhs hashes=%d target=%d height=%d best=%s',
|
||||
stat.hashrate / 1000 | 0,
|
||||
|
||||
@ -105,18 +105,17 @@ BlockTemplate.prototype.createCoinbase = function createCoinbase() {
|
||||
input = new Input();
|
||||
|
||||
// Height (required in v2+ blocks)
|
||||
input.script.set(0, new BN(this.height));
|
||||
input.script.push(new BN(this.height));
|
||||
|
||||
// Let the world know this little
|
||||
// miner succeeded.
|
||||
input.script.set(1, encoding.ZERO_HASH160);
|
||||
// Coinbase flags.
|
||||
input.script.push(encoding.ZERO_HASH160);
|
||||
|
||||
// Smaller nonce for good measure.
|
||||
input.script.set(2, util.nonce().slice(0, 4));
|
||||
input.script.push(util.nonce().slice(0, 4));
|
||||
|
||||
// extraNonce - incremented when
|
||||
// Extra nonce: incremented when
|
||||
// the nonce overflows.
|
||||
input.script.set(3, extraNonce(0, 0));
|
||||
input.script.push(extraNonce(0, 0));
|
||||
|
||||
input.script.compile();
|
||||
|
||||
@ -180,6 +179,9 @@ BlockTemplate.prototype.createCoinbase = function createCoinbase() {
|
||||
|
||||
cb.refresh();
|
||||
|
||||
assert(input.script.getSize() <= 100,
|
||||
'Coinbase input script is too large!');
|
||||
|
||||
return cb;
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user