miner: 4 byte nonces.
This commit is contained in:
parent
8e6819714b
commit
a61679c4a9
@ -232,8 +232,8 @@ MinerBlock.prototype.updateNonce = function updateNonce() {
|
||||
this.block.nonce = 0;
|
||||
this.nonce1++;
|
||||
|
||||
// Wrap at 6 bytes.
|
||||
if (this.nonce1 === 0xffffffffffff) {
|
||||
// Wrap at 4 bytes.
|
||||
if (this.nonce1 === 0xffffffff) {
|
||||
this.nonce1 = 0;
|
||||
this.nonce2++;
|
||||
}
|
||||
@ -270,11 +270,9 @@ MinerBlock.prototype.updateMerkle = function updateMerkle() {
|
||||
*/
|
||||
|
||||
MinerBlock.prototype.extraNonce = function extraNonce() {
|
||||
var bw = new StaticWriter(12);
|
||||
bw.writeU32BE(this.nonce1 / 0x10000 | 0);
|
||||
bw.writeU16BE(this.nonce1 & 0xffff);
|
||||
bw.writeU32BE(this.nonce2 / 0x10000 | 0);
|
||||
bw.writeU16BE(this.nonce2 & 0xffff);
|
||||
var bw = new StaticWriter(8);
|
||||
bw.writeU32BE(this.nonce1);
|
||||
bw.writeU32BE(this.nonce2);
|
||||
return bw.render();
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user