Commit aef5eed6 authored by Sergei Zubov's avatar Sergei Zubov

Modify network settings

Add MaxReorgLength and change stake min confirmations.
Add checkpoint with genesis block.
parent 711c9139
...@@ -31,7 +31,7 @@ namespace NBitcoin ...@@ -31,7 +31,7 @@ namespace NBitcoin
public double FeeRate { get; set; } public double FeeRate { get; set; }
/// <summary> /// <summary>
/// Splits fee between miner and DeStream /// Splits fee between miner and DeStream
/// </summary> /// </summary>
/// <param name="fee">Total amount of fees to be split</param> /// <param name="fee">Total amount of fees to be split</param>
/// <param name="deStreamFee">DeStream fee part</param> /// <param name="deStreamFee">DeStream fee part</param>
...@@ -134,15 +134,20 @@ namespace NBitcoin.Networks ...@@ -134,15 +134,20 @@ namespace NBitcoin.Networks
this.Consensus.MaxMoney = long.MaxValue; this.Consensus.MaxMoney = long.MaxValue;
this.Consensus.ProofOfWorkReward = Money.Zero; this.Consensus.ProofOfWorkReward = Money.Zero;
this.Consensus.ProofOfStakeReward = Money.Zero; this.Consensus.ProofOfStakeReward = Money.Zero;
this.Consensus.CoinbaseMaturity = 10; this.Consensus.CoinbaseMaturity = 50;
this.Consensus.MaxReorgLength = 500;
this.DeStreamFeePart = 0.9; this.DeStreamFeePart = 0.9;
this.FeeRate = 0.0077; this.FeeRate = 0.0077;
this.Checkpoints = new Dictionary<int, CheckpointInfo>(); this.Checkpoints = new Dictionary<int, CheckpointInfo>
// TODO: Add genesis and premine block to Checkpoints {
// First parameter - block height {
// { 0, new CheckpointInfo(new uint256("0x00000e246d7b73b88c9ab55f2e5e94d9e22d471def3df5ea448f5576b1d156b9"), new uint256("0x0000000000000000000000000000000000000000000000000000000000000000")) }, 0, new CheckpointInfo(
new uint256("0x95dfb30e229e18197a812ece5d8d6c03efc9b9b65a9122a73f17d99613841b1b"),
new uint256("0x0000000000000000000000000000000000000000000000000000000000000000"))
}
};
this.Base58Prefixes = new byte[12][]; this.Base58Prefixes = new byte[12][];
this.Base58Prefixes[(int) Base58Type.PUBKEY_ADDRESS] = new byte[] {30}; this.Base58Prefixes[(int) Base58Type.PUBKEY_ADDRESS] = new byte[] {30};
......
...@@ -71,7 +71,7 @@ namespace Stratis.Bitcoin.Features.Consensus ...@@ -71,7 +71,7 @@ namespace Stratis.Bitcoin.Features.Consensus
.AddFeature<ConsensusFeature>() .AddFeature<ConsensusFeature>()
.FeatureServices(services => .FeatureServices(services =>
{ {
fullNodeBuilder.Network.Consensus.Options = new PosConsensusOptions(); fullNodeBuilder.Network.Consensus.Options = new DeStreamPosConsensusOptions();
services.AddSingleton<ICheckpoints, Checkpoints>(); services.AddSingleton<ICheckpoints, Checkpoints>();
services.AddSingleton<DBreezeCoinView, DeStreamDBreezeCoinView>(); services.AddSingleton<DBreezeCoinView, DeStreamDBreezeCoinView>();
......
using NBitcoin;
using Stratis.Bitcoin.Utilities;
namespace Stratis.Bitcoin.Features.Consensus
{
public class DeStreamPosConsensusOptions : PosConsensusOptions
{
public override int GetStakeMinConfirmations(int height, Network network)
{
if(network.IsTest())
return height < CoinstakeMinConfirmationActivationHeightTestnet ? 10 : 20;
return 500;
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment