Introduces helper functions to make it easy to bury future deployments, along the lines of the suggestion from 11398 “I would prefer it if a buried deployment wouldn’t require all code paths that check the BIP9 status to require changing”.
This provides three functions: DeploymentEnabled()
which tests if a deployment can ever be active, DeploymentActiveAt()
which checks if a deployment should be enforced in the given block, and DeploymentActiveAfter()
which checks if a deployment should be enforced in the block following the given block, and overloads all three to work both with buried deployments and versionbits deployments.
This adds a dedicated lock for the versionbits cache, which is acquired internally by the versionbits functions, rather than relying on cs_main
. It also moves moves versionbitscache into deploymentstatus to avoid a circular dependency with validation.