miner: wrap nonces correctly.
This commit is contained in:
parent
b77b814be4
commit
0f4348af6d
@ -230,12 +230,13 @@ MinerBlock.prototype.updateNonce = function updateNonce() {
|
||||
|
||||
// Overflow the nonce and increment the extraNonce.
|
||||
this.block.nonce = 0;
|
||||
|
||||
this.nonce1++;
|
||||
this.nonce1 &= 0xffffffffffff;
|
||||
|
||||
if (this.nonce1 === 0)
|
||||
// Wrap at 6 bytes.
|
||||
if (this.nonce1 === 0xffffffffffff) {
|
||||
this.nonce1 = 0;
|
||||
this.nonce2++;
|
||||
}
|
||||
|
||||
// We incremented the extraNonce, need to update coinbase.
|
||||
this.updateCoinbase();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user