Skip to content

Commit 3b32f2d

Browse files
authored
Merge pull request bitcoin#548 from jameshilliard/bip91-confperiod
Use a smaller deployment period for BIP91 but don't enforce until active.
2 parents e6e7ee1 + 68a1b67 commit 3b32f2d

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

bip-0091.mediawiki

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ This BIP provides a way for a simple majority of miners to coordinate activation
2828

2929
==Specification==
3030

31-
While this BIP is active or locked in, all blocks must set the nVersion header top 3 bits to 001 together with bit field (1<<1) (according to the existing segwit deployment). Blocks that do not signal as required will be rejected.
31+
While this BIP is active, all blocks must set the nVersion header top 3 bits to 001 together with bit field (1<<1) (according to the existing segwit deployment). Blocks that do not signal as required will be rejected.
3232

3333
==Deployment==
3434

35-
This BIP will be deployed by a "version bits" with an 80%(this can be adjusted if desired) 538 block activation threshold and 672 block confirmation window BIP9 with the name "segsignal" and using bit 4.
35+
This BIP will be deployed by a "version bits" with an 80%(this can be adjusted if desired) 269 block activation threshold and 336 block confirmation window BIP9 with the name "segsignal" and using bit 4.
3636

3737
This BIP will have a start time of midnight June 1st, 2017 (epoch time 1496275200) and timeout on midnight November 15th 2017 (epoch time 1510704000). This BIP will cease to be active when segwit is locked-in.
3838

@@ -43,8 +43,8 @@ This BIP will have a start time of midnight June 1st, 2017 (epoch time 149627520
4343
consensus.vDeployments[Consensus::DEPLOYMENT_SEGSIGNAL].bit = 4;
4444
consensus.vDeployments[Consensus::DEPLOYMENT_SEGSIGNAL].nStartTime = 1496275200; // June 1st, 2017.
4545
consensus.vDeployments[Consensus::DEPLOYMENT_SEGSIGNAL].nTimeout = 1510704000; // November 15th, 2017.
46-
consensus.vDeployments[Consensus::DEPLOYMENT_SEGSIGNAL].nOverrideMinerConfirmationWindow = 672; // ~4.67 days
47-
consensus.vDeployments[Consensus::DEPLOYMENT_SEGSIGNAL].nOverrideRuleChangeActivationThreshold = 538; // 80%
46+
consensus.vDeployments[Consensus::DEPLOYMENT_SEGSIGNAL].nOverrideMinerConfirmationWindow = 336; // ~2.33 days
47+
consensus.vDeployments[Consensus::DEPLOYMENT_SEGSIGNAL].nOverrideRuleChangeActivationThreshold = 269; // 80%
4848

4949
class VersionBitsConditionChecker : public AbstractThresholdConditionChecker {
5050
private:
@@ -74,18 +74,9 @@ public:
7474
uint32_t Mask(const Consensus::Params& params) const { return ((uint32_t)1) << params.vDeployments[id].bit; }
7575
};
7676

77-
// Check if Segregated Witness is Locked In
78-
bool IsWitnessLockedIn(const CBlockIndex* pindexPrev, const Consensus::Params& params)
79-
{
80-
LOCK(cs_main);
81-
return (VersionBitsState(pindexPrev, params, Consensus::DEPLOYMENT_SEGWIT, versionbitscache) == THRESHOLD_LOCKED_IN);
82-
}
83-
8477
// SEGSIGNAL mandatory segwit signalling.
85-
if ((VersionBitsState(pindex->pprev, chainparams.GetConsensus(), Consensus::DEPLOYMENT_SEGSIGNAL, versionbitscache) == THRESHOLD_ACTIVE ||
86-
VersionBitsState(pindex->pprev, chainparams.GetConsensus(), Consensus::DEPLOYMENT_SEGSIGNAL, versionbitscache) == THRESHOLD_LOCKED_IN) &&
87-
!IsWitnessLockedIn(pindex->pprev, chainparams.GetConsensus()) && // Segwit is not locked in
88-
!IsWitnessEnabled(pindex->pprev, chainparams.GetConsensus()) ) // and is not active.
78+
if (VersionBitsState(pindex->pprev, chainparams.GetConsensus(), Consensus::DEPLOYMENT_SEGSIGNAL, versionbitscache) == THRESHOLD_ACTIVE &&
79+
VersionBitsState(pindex->pprev, chainparams.GetConsensus(), Consensus::DEPLOYMENT_SEGWIT, versionbitscache) == THRESHOLD_STARTED)
8980
{
9081
bool fVersionBits = (pindex->nVersion & VERSIONBITS_TOP_MASK) == VERSIONBITS_TOP_BITS;
9182
bool fSegbit = (pindex->nVersion & VersionBitsMask(chainparams.GetConsensus(), Consensus::DEPLOYMENT_SEGWIT)) != 0;

0 commit comments

Comments
 (0)