Skip to content

Commit

Permalink
Merge cb09bc2 into 11210cb
Browse files Browse the repository at this point in the history
  • Loading branch information
unitof committed May 16, 2018
2 parents 11210cb + cb09bc2 commit 61b9dbd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion example.js
Expand Up @@ -30,7 +30,7 @@ const testBlocks = [
];

const selectedBlock = 0; // CHANGE THIS TO 1 to use the second testBlock
const { block } = testBlocks[selectedBlock];
const {block} = testBlocks[selectedBlock];
let nonce = testBlocks[selectedBlock].initialNonce;

const miner = new BTCMiner(block);
Expand Down
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -6,7 +6,7 @@ class Miner {
// Initialize local variables with Block data
const prevBlockHash = Buffer.from(block.previousblockhash, 'hex');
const mrklRoot = Buffer.from(block.merkleroot, 'hex');
const { time, version } = block;
const {time, version} = block;

// Calculate target based on block's "bits",
// The "bits" variable is a packed representation of the Difficulty in 8 bytes, to unpack it:
Expand All @@ -22,7 +22,7 @@ class Miner {

// Create little-endian long int (4 bytes) with the version (2) on the first byte
this.versionBuffer = Buffer.alloc(4);
this.versionBuffer.writeInt32LE(ver, 0);
this.versionBuffer.writeInt32LE(version, 0);

// Reverse the previous Block Hash and the merkle_root
this.reversedPrevBlockHash = this.reverseBuffer(prevBlockHash);
Expand Down

0 comments on commit 61b9dbd

Please sign in to comment.