0

what do these values in chainparams.cpp do?

consensus.nMajorityEnforceBlockUpgrade = 2;
consensus.nMajorityRejectBlockOutdated = 3;
consensus.nMajorityWindow = 3;

and how do I find them in the existing blockchain when upgrading end for new?

first time I think it's when start diff grow up, but now think it's wrong.

2 Answers 2

0

Those values are part of the IsSuperMajority soft fork deployment system. This method of deploying soft forks is no longer used in Bitcoin now and have been removed. Those values are for the parameters that will activate a soft fork that uses the IsSuperMajority method; they are not relevant if you don't have any soft forks to deploy.

nMajorityEnforceBlockUpgrade is the threshold for enforcing the new consensus rules specified by the soft fork. nMajorityRejectBlockOutdated is the threshold for rejecting all blocks that don't have the version number specified by the soft fork. nMajorityWindow is the number of blocks in the window that are being checked.

For example, with the numbers you posted, suppose you are activating a soft fork where miners signal by setting their block version numbers to 2 or greater. If 2 (nMajorityEnforceBlockUpgrade) out of the last 3 (nMajorityWindow) blocks have a version number of 2 or greater, then you begin enforcing the new rules specified by the soft fork (e.g. block height in coinbase). If 3 (nMajorityRejectBlockOutdated) out of the last 3 (nMajorityWindow) blocks are version number 2 or greater, then any block with a version number less than 2 (i.e. 1 or 0) are now invalid and will be rejected.

0

what do these values in chainparams.cpp do?

If nMajorityEnforceBlockUpgrade out of the last nMajorityWindow blocks have signaled support for a softfork, enforce the softfork's rules on the blocks that have signaled support.

If nMajorityRejectBlockOutdated out of the last nMajorityWindow blocks have signaled support for a softfork, mark blocks with an old version as invalid.

These are for BIP34 style softforks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.