|
2 | 2 |
|
3 | 3 | namespace City.Networks.Deployments |
4 | 4 | { |
5 | | - /// <summary> |
6 | | - /// BIP9 deployments for the Blockcore sample coin network. |
7 | | - /// </summary> |
8 | | - public class CityBIP9Deployments : BIP9DeploymentsArray |
9 | | - { |
10 | | - // The position of each deployment in the deployments array. Note that this is decoupled from the actual position of the flag bit for the deployment in the block version. |
11 | | - public const int TestDummy = 0; |
12 | | - public const int CSV = 1; |
13 | | - public const int Segwit = 2; |
14 | | - public const int ColdStaking = 3; |
15 | | - |
16 | | - // The number of deployments. |
17 | | - public const int NumberOfDeployments = 4; |
18 | | - |
19 | | - /// <summary> |
20 | | - /// Constructs the BIP9 deployments array. |
21 | | - /// </summary> |
22 | | - public CityBIP9Deployments() : base(NumberOfDeployments) |
23 | | - { |
24 | | - } |
25 | | - |
26 | | - /// <summary> |
27 | | - /// Gets the deployment flags to set when the deployment activates. |
28 | | - /// </summary> |
29 | | - /// <param name="deployment">The deployment number.</param> |
30 | | - /// <returns>The deployment flags.</returns> |
31 | | - public override BIP9DeploymentFlags GetFlags(int deployment) |
32 | | - { |
33 | | - var flags = new BIP9DeploymentFlags(); |
34 | | - |
35 | | - switch (deployment) |
36 | | - { |
37 | | - case ColdStaking: |
38 | | - flags.ScriptFlags |= ScriptVerify.CheckColdStakeVerify; |
39 | | - break; |
40 | | - |
41 | | - case CSV: |
42 | | - // Start enforcing BIP68 (sequence locks), BIP112 (CHECKSEQUENCEVERIFY) and BIP113 (Median Time Past) using versionbits logic. |
43 | | - flags.ScriptFlags = ScriptVerify.CheckSequenceVerify; |
44 | | - flags.LockTimeFlags = Transaction.LockTimeFlags.VerifySequence | Transaction.LockTimeFlags.MedianTimePast; |
45 | | - break; |
46 | | - |
47 | | - case Segwit: |
48 | | - // Start enforcing WITNESS rules using versionbits logic. |
49 | | - flags.ScriptFlags = ScriptVerify.Witness; |
50 | | - break; |
51 | | - } |
52 | | - |
53 | | - return flags; |
54 | | - } |
55 | | - } |
| 5 | + /// <summary> |
| 6 | + /// BIP9 deployments for the Blockcore sample coin network. |
| 7 | + /// </summary> |
| 8 | + public class CityBIP9Deployments : BIP9DeploymentsArray |
| 9 | + { |
| 10 | + // The position of each deployment in the deployments array. Note that this is decoupled from the actual position of the flag bit for the deployment in the block version. |
| 11 | + public const int TestDummy = 0; |
| 12 | + public const int ColdStaking = 2; |
| 13 | + |
| 14 | + // The number of deployments. |
| 15 | + public const int NumberOfDeployments = ColdStaking + 1; |
| 16 | + |
| 17 | + /// <summary> |
| 18 | + /// Constructs the BIP9 deployments array. |
| 19 | + /// </summary> |
| 20 | + public CityBIP9Deployments() : base(NumberOfDeployments) |
| 21 | + { |
| 22 | + } |
| 23 | + |
| 24 | + /// <summary> |
| 25 | + /// Gets the deployment flags to set when the deployment activates. |
| 26 | + /// </summary> |
| 27 | + /// <param name="deployment">The deployment number.</param> |
| 28 | + /// <returns>The deployment flags.</returns> |
| 29 | + public override BIP9DeploymentFlags GetFlags(int deployment) |
| 30 | + { |
| 31 | + var flags = new BIP9DeploymentFlags(); |
| 32 | + |
| 33 | + switch (deployment) |
| 34 | + { |
| 35 | + case ColdStaking: |
| 36 | + flags.ScriptFlags |= ScriptVerify.CheckColdStakeVerify; |
| 37 | + break; |
| 38 | + } |
| 39 | + |
| 40 | + return flags; |
| 41 | + } |
| 42 | + } |
56 | 43 | } |
0 commit comments