Esempio n. 1
0
        public Ledger(IPersistentAccountStore persistentStore)
        {
            this.LedgerTree = new ListHashTree();
            this.persistentStore = persistentStore;
            this.TransactionFees = 0;
            this.TotalAmount = 0;
            //this.CloseTime = 0;

        }
Esempio n. 2
0
        public LedgerSync(NodeState nodeState, NodeConfig nodeConfig, NetworkPacketSwitch networkPacketSwitch)
        {
            this.nodeState = nodeState;
            this.nodeConfig = nodeConfig;
            this.networkPacketSwitch = networkPacketSwitch;
            this.LedgerTree = nodeState.Ledger.LedgerTree; // Just aliasing.

            LedgerState = LedgerSyncStateTypes.ST_GOOD;

            this.networkPacketSwitch.LedgerSyncEvent += networkHandler_LedgerSyncEvent;

            TimerLedgerSync = new System.Timers.Timer();
            if (Enable) TimerLedgerSync.Elapsed += TimerLedgerSync_Elapsed;
            TimerLedgerSync.Enabled = true;
            TimerLedgerSync.Interval = nodeConfig.UpdateFrequencyLedgerSyncMS;
            TimerLedgerSync.Start();

            TimerLedgerSync_Root = new System.Timers.Timer();
            if (Enable) TimerLedgerSync_Root.Elapsed += TimerLedgerSync_Root_Elapsed;
            TimerLedgerSync_Root.Enabled = true;
            TimerLedgerSync_Root.Interval = nodeConfig.UpdateFrequencyLedgerSyncMS_Root;
            TimerLedgerSync_Root.Start();
        }