public IncomingTransactionMap(NodeState nodeState, NodeConfig nodeConfig, TransactionStateManager transactionStateManager)
        {
            this.nodeState = nodeState;
            this.nodeConfig = nodeConfig;
            this.transactionStateManager = transactionStateManager;

            IncomingTransactions = new ConcurrentDictionary<Hash, TransactionContent>();

            System.Timers.Timer Tmr = new System.Timers.Timer();
            Tmr.Elapsed += Tmr_Elapsed;
            Tmr.Enabled = true;
            Tmr.Interval = nodeConfig.UpdateFrequencyPacketProcessMS;
            Tmr.Start();
        }
示例#2
0
        public NodeState(NodeConfig nodeConfig)
        {
            PersistentAccountStore = new SQLiteAccountStore(nodeConfig);
            PersistentTransactionStore = new SQLiteTransactionStore(nodeConfig);
            PersistentBannedNameStore = new SQLiteBannedNames(nodeConfig);
            PersistentCloseHistory = new SQLiteCloseHistory(nodeConfig);

            Ledger = new Ledger(PersistentAccountStore);

            TransactionStateManager = new TransactionStateManager();
            IncomingTransactionMap = new IncomingTransactionMap(this, nodeConfig, TransactionStateManager);

            GlobalBlacklistedValidators = new ConcurrentBag<Hash>();
            GlobalBlacklistedUsers = new ConcurrentBag<Hash>();

            ConnectedValidators = new HashSet<Hash>();

            PendingNetworkRequests = new ConcurrentDictionary<Hash, PendingNetworkRequest>();

            SystemTime = DateTime.UtcNow.ToFileTimeUtc();
            NetworkTime = DateTime.UtcNow.ToFileTimeUtc();
        }