Skip to content

Commit

Permalink
removed [warning] unknown version bit in block
Browse files Browse the repository at this point in the history
  • Loading branch information
pradyuman-verma committed Aug 12, 2021
1 parent 950e30c commit 8044bc2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
14 changes: 0 additions & 14 deletions lib/blockchain/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -1054,13 +1054,6 @@ class Chain extends AsyncEmitter {
await this.reorganize(entry);
}

// Warn of unknown versionbits.
if (entry.hasUnknown(this.network)) {
this.logger.warning(
'Unknown version bits in block %d: %s.',
entry.height, entry.version.toString(16));
}

// Otherwise, everything is in order.
// Do "contextual" verification on our block
// now that we're certain its previous
Expand Down Expand Up @@ -1129,13 +1122,6 @@ class Chain extends AsyncEmitter {
throw err;
}

// Warn of unknown versionbits.
if (entry.hasUnknown(this.network)) {
this.logger.warning(
'Unknown version bits in block %d: %s.',
entry.height, entry.version.toString(16));
}

await this.db.save(entry, block);

this.logger.warning('Heads up: Competing chain at height %d:'
Expand Down
17 changes: 0 additions & 17 deletions lib/blockchain/chainentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,23 +145,6 @@ class ChainEntry {
return this.height === 0;
}

/**
* Test whether the entry contains an unknown version bit.
* @param {Network} network
* @returns {Boolean}
*/

hasUnknown(network) {
const TOP_MASK = consensus.VERSION_TOP_MASK;
const TOP_BITS = consensus.VERSION_TOP_BITS;
const bits = (this.version & TOP_MASK) >>> 0;

if (bits !== TOP_BITS)
return false;

return (this.version & network.unknownBits) !== 0;
}

/**
* Test whether the entry contains a version bit.
* @param {Number} bit
Expand Down

0 comments on commit 8044bc2

Please sign in to comment.