Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed [warning] (chain) unknown version bits in block #1029

Merged
merged 1 commit into from
Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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