Skip to content

Commit 57a93a8

Browse files
authored
Update bitcoin checkpoints and defaultAssumeValid (#436)
* update bitcoin checkpoints and defaultAssumeValid * add hex prefix * Fix tests * one more test fix
1 parent f4f7330 commit 57a93a8

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/Networks/Blockcore.Networks.Bitcoin/BitcoinMain.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public BitcoinMain()
9595
bip34Hash: new uint256("0x000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8"),
9696
minerConfirmationWindow: 2016, // nPowTargetTimespan / nPowTargetSpacing
9797
maxReorgLength: 0,
98-
defaultAssumeValid: new uint256("0000000000000000000304dece599f1d046f5c606deec3d1d49eb24b3231b4a3"), // 629000
98+
defaultAssumeValid: new uint256("0x00000000000000000003e1d91b245eb32787afb10afe49b61621375361221c38"), // 760000
9999
maxMoney: 21000000 * Money.COIN,
100100
coinbaseMaturity: 100,
101101
premineHeight: 0,
@@ -152,7 +152,8 @@ public BitcoinMain()
152152
{ 486000, new CheckpointInfo(new uint256("0x000000000000000000a2a8104d61651f76c666b70754d6e9346176385f7afa24"))},
153153
{ 491800, new CheckpointInfo(new uint256("0x000000000000000000d80de1f855902b50941bc3a3d0f71064d9613fd3943dc4"))},
154154
{ 550000, new CheckpointInfo(new uint256("0x000000000000000000223b7a2298fb1c6c75fb0efc28a4c56853ff4112ec6bc9"))}, // 14-11-2018,
155-
{ 610000, new CheckpointInfo(new uint256("0x0000000000000000000a6f607f74db48dae0a94022c10354536394c17672b7f7"))} // 27-12-2019
155+
{ 610000, new CheckpointInfo(new uint256("0x0000000000000000000a6f607f74db48dae0a94022c10354536394c17672b7f7"))}, // 27-12-2019
156+
{ 765000, new CheckpointInfo(new uint256("0x00000000000000000006e35496e6056700db72df0815e38863cad399df7b5373"))} // 28-11-2022
156157
};
157158

158159
this.DNSSeeds = new List<DNSSeedData>

src/Tests/Blockcore.Tests/Consensus/CheckpointsTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void GetLastCheckPointHeight_BitcoinMainnet_ReturnsLastCheckPointHeight()
4646

4747
int result = checkpoints.GetLastCheckpointHeight();
4848

49-
Assert.Equal(610000, result);
49+
Assert.Equal(765000, result);
5050
}
5151

5252
[Fact]
@@ -111,7 +111,7 @@ public void GetLastCheckPointHeight_CheckpointsEnabledAfterLoad_RetrievesCheckpo
111111
consensusSettings.UseCheckpoints = true;
112112

113113
result = checkpoints.GetLastCheckpointHeight();
114-
Assert.Equal(610000, result);
114+
Assert.Equal(765000, result);
115115
}
116116

117117
[Fact]

src/Tests/Blockcore.Tests/NBitcoin/NetworkTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void ReadMagicByteWithFirstByteDuplicated()
7878
[Fact]
7979
public void BitcoinMainnetIsInitializedCorrectly()
8080
{
81-
Assert.Equal(17, this.networkMain.Checkpoints.Count);
81+
Assert.Equal(18, this.networkMain.Checkpoints.Count);
8282
Assert.Equal(6, this.networkMain.DNSSeeds.Count);
8383
Assert.Equal(512, this.networkMain.SeedNodes.Count);
8484

@@ -140,7 +140,7 @@ public void BitcoinMainnetIsInitializedCorrectly()
140140
Assert.Equal(Utils.UnixTimeToDateTime(1510704000), this.networkMain.Consensus.BIP9Deployments[BitcoinBIP9Deployments.Segwit].Timeout);
141141
Assert.Equal(0, this.networkMain.Consensus.CoinType);
142142
Assert.False(this.networkMain.Consensus.IsProofOfStake);
143-
Assert.Equal(new uint256("0x0000000000000000000304dece599f1d046f5c606deec3d1d49eb24b3231b4a3"), this.networkMain.Consensus.DefaultAssumeValid);
143+
Assert.Equal(new uint256("0x00000000000000000003e1d91b245eb32787afb10afe49b61621375361221c38"), this.networkMain.Consensus.DefaultAssumeValid);
144144
Assert.Equal(100, this.networkMain.Consensus.CoinbaseMaturity);
145145
Assert.Equal(0, this.networkMain.Consensus.PremineReward);
146146
Assert.Equal(0, this.networkMain.Consensus.PremineHeight);

0 commit comments

Comments
 (0)