Skip to content

Commit

Permalink
Update bitcoin checkpoints and defaultAssumeValid (#436)
Browse files Browse the repository at this point in the history
* update bitcoin checkpoints and defaultAssumeValid

* add hex prefix

* Fix tests

* one more test fix
  • Loading branch information
dangershony authored Jan 20, 2023
1 parent f4f7330 commit 57a93a8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/Networks/Blockcore.Networks.Bitcoin/BitcoinMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public BitcoinMain()
bip34Hash: new uint256("0x000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8"),
minerConfirmationWindow: 2016, // nPowTargetTimespan / nPowTargetSpacing
maxReorgLength: 0,
defaultAssumeValid: new uint256("0000000000000000000304dece599f1d046f5c606deec3d1d49eb24b3231b4a3"), // 629000
defaultAssumeValid: new uint256("0x00000000000000000003e1d91b245eb32787afb10afe49b61621375361221c38"), // 760000
maxMoney: 21000000 * Money.COIN,
coinbaseMaturity: 100,
premineHeight: 0,
Expand Down Expand Up @@ -152,7 +152,8 @@ public BitcoinMain()
{ 486000, new CheckpointInfo(new uint256("0x000000000000000000a2a8104d61651f76c666b70754d6e9346176385f7afa24"))},
{ 491800, new CheckpointInfo(new uint256("0x000000000000000000d80de1f855902b50941bc3a3d0f71064d9613fd3943dc4"))},
{ 550000, new CheckpointInfo(new uint256("0x000000000000000000223b7a2298fb1c6c75fb0efc28a4c56853ff4112ec6bc9"))}, // 14-11-2018,
{ 610000, new CheckpointInfo(new uint256("0x0000000000000000000a6f607f74db48dae0a94022c10354536394c17672b7f7"))} // 27-12-2019
{ 610000, new CheckpointInfo(new uint256("0x0000000000000000000a6f607f74db48dae0a94022c10354536394c17672b7f7"))}, // 27-12-2019
{ 765000, new CheckpointInfo(new uint256("0x00000000000000000006e35496e6056700db72df0815e38863cad399df7b5373"))} // 28-11-2022
};

this.DNSSeeds = new List<DNSSeedData>
Expand Down
4 changes: 2 additions & 2 deletions src/Tests/Blockcore.Tests/Consensus/CheckpointsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void GetLastCheckPointHeight_BitcoinMainnet_ReturnsLastCheckPointHeight()

int result = checkpoints.GetLastCheckpointHeight();

Assert.Equal(610000, result);
Assert.Equal(765000, result);
}

[Fact]
Expand Down Expand Up @@ -111,7 +111,7 @@ public void GetLastCheckPointHeight_CheckpointsEnabledAfterLoad_RetrievesCheckpo
consensusSettings.UseCheckpoints = true;

result = checkpoints.GetLastCheckpointHeight();
Assert.Equal(610000, result);
Assert.Equal(765000, result);
}

[Fact]
Expand Down
4 changes: 2 additions & 2 deletions src/Tests/Blockcore.Tests/NBitcoin/NetworkTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void ReadMagicByteWithFirstByteDuplicated()
[Fact]
public void BitcoinMainnetIsInitializedCorrectly()
{
Assert.Equal(17, this.networkMain.Checkpoints.Count);
Assert.Equal(18, this.networkMain.Checkpoints.Count);
Assert.Equal(6, this.networkMain.DNSSeeds.Count);
Assert.Equal(512, this.networkMain.SeedNodes.Count);

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

0 comments on commit 57a93a8

Please sign in to comment.