You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
6576a87 doc: Improve versionbits.h documentation (Antoine Riard)
Pull request description:
While reviewing burying of BIP 9 deployments, seen that versionbits.h wasn't that much documented. This is an attempt to improve it. It can be useful, given after burying this code isn't going to be used anymore and isn't straightforward at first sight.
ACKs for top commit:
jnewbery:
ACK 6576a87
ajtowns:
ACK 6576a87
fanquake:
ACK 6576a87
Tree-SHA512: 906463e0b22b988f89d77f798bf94d294f70467d29975088b87384764fb5d0dd1350be67562cc264656f61f1eada2cba20f99c0d797d1d7f90203c269e34c714
/** BIP 9 defines a finite-state-machine to deploy a softfork in multiple stages.
21
+
* State transitions happen during retarget period if conditions are met
22
+
* In case of reorg, transitions can go backward. Without transition, state is
23
+
* inherited between periods. All blocks of a period share the same state.
24
+
*/
20
25
enumclassThresholdState {
21
-
DEFINED,
22
-
STARTED,
23
-
LOCKED_IN,
24
-
ACTIVE,
25
-
FAILED,
26
+
DEFINED,// First state that each softfork starts out as. The genesis block is by definition in this state for each deployment.
27
+
STARTED,// For blocks past the starttime.
28
+
LOCKED_IN,// For one retarget period after the first retarget period with STARTED blocks of which at least threshold have the associated bit set in nVersion.
29
+
ACTIVE,// For all blocks after the LOCKED_IN retarget period (final state)
30
+
FAILED,// For all blocks once the first retarget period after the timeout time is hit, if LOCKED_IN wasn't already reached (final state)
26
31
};
27
32
28
33
// A map that gives the state for blocks whose height is a multiple of Period().
29
34
// The map is indexed by the block's parent, however, so all keys in the map
30
35
// will either be nullptr or a block with (height + 1) % Period() == 0.
0 commit comments