It’s more than a year ago, so just replace the 75%/95% version counting logic with a static historic switchover point.
Rebase of #5562:
- Kept IsSuperMajority as it’s used by BIP66 checks
- Moved nBIP34Height to the new consensus params structure
It's more than a year ago, so just replace the 75%/95% version counting
logic with a static historic switchover point.
Here’s a version rebased on top of #5968 and adding so more consensus params to avoid that ContextualCheckBlockHeader has to have a new couple of lines every time that a softfork gets old enough to enforce it by height rather than voting:
https://github.com/bitcoin/bitcoin/compare/master...jtimon:bip34_switchover?expand=1
Minor bug*: If the blockchain were reorganised off the switchover block, we would be breaking consensus here. I wonder if it might be good to abstract #5927 so its logic is reusable for things like this. That is, instead of “when do we enforce BIP34?”, we ask “what blocks are permitted to skip BIP34 validation?”
* This is only a bug when checkpoints are disabled or #5927 is merged.