コード例 #1
0
 public Consensus(
     ConsensusFactory consensusFactory,
     ConsensusOptions consensusOptions,
     int coinType,
     uint256 hashGenesisBlock,
     int subsidyHalvingInterval,
     int majorityEnforceBlockUpgrade,
     int majorityRejectBlockOutdated,
     int majorityWindow,
     BuriedDeploymentsArray buriedDeployments,
     BIP9DeploymentsArray bip9Deployments,
     uint256 bip34Hash,
     int ruleChangeActivationThreshold,
     int minerConfirmationWindow,
     uint maxReorgLength,
     uint256 defaultAssumeValid,
     long maxMoney,
     long coinbaseMaturity,
     long premineHeight,
     Money premineReward,
     Money proofOfWorkReward,
     TimeSpan powTargetTimespan,
     TimeSpan powTargetSpacing,
     bool powAllowMinDifficultyBlocks,
     bool powNoRetargeting,
     Target powLimit,
     uint256 minimumChainWork,
     bool isProofOfStake,
     int lastPowBlock,
     BigInteger proofOfStakeLimit,
     BigInteger proofOfStakeLimitV2,
     Money proofOfStakeReward
     )
 {
     this.Rules                         = new List <IConsensusRule>();
     this.CoinbaseMaturity              = coinbaseMaturity;
     this.PremineReward                 = premineReward;
     this.PremineHeight                 = premineHeight;
     this.ProofOfWorkReward             = proofOfWorkReward;
     this.ProofOfStakeReward            = proofOfStakeReward;
     this.MaxReorgLength                = maxReorgLength;
     this.MaxMoney                      = maxMoney;
     this.Options                       = consensusOptions;
     this.BuriedDeployments             = buriedDeployments;
     this.BIP9Deployments               = bip9Deployments;
     this.SubsidyHalvingInterval        = subsidyHalvingInterval;
     this.MajorityEnforceBlockUpgrade   = majorityEnforceBlockUpgrade;
     this.MajorityRejectBlockOutdated   = majorityRejectBlockOutdated;
     this.MajorityWindow                = majorityWindow;
     this.BIP34Hash                     = bip34Hash;
     this.PowLimit                      = powLimit;
     this.PowTargetTimespan             = powTargetTimespan;
     this.PowTargetSpacing              = powTargetSpacing;
     this.PowAllowMinDifficultyBlocks   = powAllowMinDifficultyBlocks;
     this.PowNoRetargeting              = powNoRetargeting;
     this.HashGenesisBlock              = hashGenesisBlock;
     this.MinimumChainWork              = minimumChainWork;
     this.MinerConfirmationWindow       = minerConfirmationWindow;
     this.RuleChangeActivationThreshold = ruleChangeActivationThreshold;
     this.CoinType                      = coinType;
     this.ProofOfStakeLimit             = proofOfStakeLimit;
     this.ProofOfStakeLimitV2           = proofOfStakeLimitV2;
     this.LastPOWBlock                  = lastPowBlock;
     this.IsProofOfStake                = isProofOfStake;
     this.DefaultAssumeValid            = defaultAssumeValid;
     this.ConsensusFactory              = consensusFactory;
 }
コード例 #2
0
 public Consensus(
     ConsensusFactory consensusFactory,
     ConsensusOptions consensusOptions,
     int coinType,
     uint256 hashGenesisBlock,
     int subsidyHalvingInterval,
     int majorityEnforceBlockUpgrade,
     int majorityRejectBlockOutdated,
     int majorityWindow,
     BuriedDeploymentsArray buriedDeployments,
     IBIP9DeploymentsArray bip9Deployments,
     uint256 bip34Hash,
     int ruleChangeActivationThreshold,
     int minerConfirmationWindow,
     uint maxReorgLength,
     uint256 defaultAssumeValid,
     long maxMoney,
     long coinbaseMaturity,
     long premineHeight,
     Money premineReward,
     Money proofOfWorkReward,
     TimeSpan powTargetTimespan,
     TimeSpan powTargetSpacing,
     bool powAllowMinDifficultyBlocks,
     bool posNoRetargeting,
     bool powNoRetargeting,
     Target powLimit,
     uint256 minimumChainWork,
     bool isProofOfStake,
     int lastPowBlock,
     BigInteger proofOfStakeLimit,
     BigInteger proofOfStakeLimitV2,
     Money proofOfStakeReward,
     bool posRewardReduction               = false,
     int posRewardReductionBlockInterval   = 0,
     decimal posRewardMinterPercentage     = 1m,
     decimal posRewardFoundationPercentage = 0m,
     string posRewardFoundationPubKeyHash  = null,
     decimal posRewardReductionPercentage  = 0m,
     int serviceNodeCollateralBlockPeriod  = 0,
     int serviceNodeCollateralThreshold    = 0)
 {
     this.IntegrityValidationRules         = new List <IIntegrityValidationConsensusRule>();
     this.HeaderValidationRules            = new List <IHeaderValidationConsensusRule>();
     this.PartialValidationRules           = new List <IPartialValidationConsensusRule>();
     this.FullValidationRules              = new List <IFullValidationConsensusRule>();
     this.CoinbaseMaturity                 = coinbaseMaturity;
     this.PremineReward                    = premineReward;
     this.PremineHeight                    = premineHeight;
     this.ProofOfWorkReward                = proofOfWorkReward;
     this.ProofOfStakeReward               = proofOfStakeReward;
     this.PosRewardReduction               = posRewardReduction;
     this.PosRewardReductionBlockInterval  = posRewardReductionBlockInterval;
     this.PosRewardMinterPercentage        = posRewardMinterPercentage;
     this.PosRewardFoundationPercentage    = posRewardFoundationPercentage;
     this.PosRewardFoundationPubKeyHash    = posRewardFoundationPubKeyHash;
     this.PosRewardReductionPercentage     = posRewardReductionPercentage;
     this.ServiceNodeCollateralThreshold   = serviceNodeCollateralThreshold;
     this.ServiceNodeCollateralBlockPeriod = serviceNodeCollateralBlockPeriod;
     this.MaxReorgLength                   = maxReorgLength;
     this.MaxMoney                      = maxMoney;
     this.Options                       = consensusOptions;
     this.BuriedDeployments             = buriedDeployments;
     this.BIP9Deployments               = bip9Deployments;
     this.SubsidyHalvingInterval        = subsidyHalvingInterval;
     this.MajorityEnforceBlockUpgrade   = majorityEnforceBlockUpgrade;
     this.MajorityRejectBlockOutdated   = majorityRejectBlockOutdated;
     this.MajorityWindow                = majorityWindow;
     this.BIP34Hash                     = bip34Hash;
     this.PowLimit                      = powLimit;
     this.PowTargetTimespan             = powTargetTimespan;
     this.PowTargetSpacing              = powTargetSpacing;
     this.PowAllowMinDifficultyBlocks   = powAllowMinDifficultyBlocks;
     this.PosNoRetargeting              = posNoRetargeting;
     this.PowNoRetargeting              = powNoRetargeting;
     this.HashGenesisBlock              = hashGenesisBlock;
     this.MinimumChainWork              = minimumChainWork;
     this.MinerConfirmationWindow       = minerConfirmationWindow;
     this.RuleChangeActivationThreshold = ruleChangeActivationThreshold;
     this.CoinType                      = coinType;
     this.ProofOfStakeLimit             = proofOfStakeLimit;
     this.ProofOfStakeLimitV2           = proofOfStakeLimitV2;
     this.LastPOWBlock                  = lastPowBlock;
     this.IsProofOfStake                = isProofOfStake;
     this.DefaultAssumeValid            = defaultAssumeValid;
     this.ConsensusFactory              = consensusFactory;
 }