示例#1
0
 public PowMining(
     ConsensusLoop consensusLoop,
     ConcurrentChain chain,
     Network network,
     IDateTimeProvider dateTimeProvider,
     AssemblerFactory blockAssemblerFactory,
     IBlockRepository blockRepository,
     ChainState chainState,
     Signals.Signals signals,
     INodeLifetime nodeLifetime,
     IAsyncLoopFactory asyncLoopFactory,
     ILoggerFactory loggerFactory)
 {
     this.consensusLoop         = consensusLoop;
     this.chain                 = chain;
     this.network               = network;
     this.dateTimeProvider      = dateTimeProvider;
     this.blockAssemblerFactory = blockAssemblerFactory;
     this.blockRepository       = blockRepository;
     this.chainState            = chainState;
     this.signals               = signals;
     this.nodeLifetime          = nodeLifetime;
     this.asyncLoopFactory      = asyncLoopFactory;
     this.logger                = loggerFactory.CreateLogger(this.GetType().FullName);
 }
示例#2
0
        public PosMinting(
            ConsensusLoop consensusLoop,
            ConcurrentChain chain,
            Network network,
            IConnectionManager connection,
            IDateTimeProvider dateTimeProvider,
            AssemblerFactory blockAssemblerFactory,
            IBlockRepository blockRepository,
            ChainState chainState,
            Signals.Signals signals, INodeLifetime nodeLifetime,
            NodeSettings settings,
            CoinView coinView,
            StakeChain stakeChain,
            IWalletManager wallet,
            IAsyncLoopFactory asyncLoopFactory,
            ILoggerFactory loggerFactory)
        {
            this.consensusLoop         = consensusLoop;
            this.chain                 = chain;
            this.network               = network;
            this.connection            = connection;
            this.dateTimeProvider      = dateTimeProvider;
            this.blockAssemblerFactory = blockAssemblerFactory;
            this.blockRepository       = blockRepository;
            this.chainState            = chainState;
            this.signals               = signals;
            this.nodeLifetime          = nodeLifetime;
            this.settings              = settings;
            this.coinView              = coinView;
            this.stakeChain            = stakeChain;
            this.asyncLoopFactory      = asyncLoopFactory;
            this.walletManager         = wallet as WalletManager;
            this.logger                = loggerFactory.CreateLogger(this.GetType().FullName);

            this.minerSleep = 500;                                                                          // GetArg("-minersleep", 500);
            this.lastCoinStakeSearchTime = Utils.DateTimeToUnixTime(this.dateTimeProvider.GetTimeOffset()); // startup timestamp
            this.reserveBalance          = 0;                                                               // TOOD:settings.ReserveBalance
            this.minimumInputValue       = 0;

            this.posConsensusValidator = consensusLoop.Validator as PosConsensusValidator;
        }