public TransactionPool(ITransactionStorage transactionStorage, IPendingTransactionThresholdValidator pendingTransactionThresholdValidator, ITimestamp timestamp, IEthereumEcdsa ecdsa, ISpecProvider specProvider, ILogManager logManager, int removePendingTransactionInterval = 600, int peerNotificationThreshold = 20) { _logger = logManager?.GetClassLogger() ?? throw new ArgumentNullException(nameof(logManager)); _transactionStorage = transactionStorage ?? throw new ArgumentNullException(nameof(transactionStorage)); _pendingTransactionThresholdValidator = pendingTransactionThresholdValidator; _timestamp = timestamp ?? throw new ArgumentNullException(nameof(timestamp)); _ecdsa = ecdsa ?? throw new ArgumentNullException(nameof(ecdsa)); _specProvider = specProvider ?? throw new ArgumentNullException(nameof(specProvider)); _peerNotificationThreshold = peerNotificationThreshold; if (removePendingTransactionInterval <= 0) { return; } var timer = new Timer(removePendingTransactionInterval * 1000); timer.Elapsed += OnTimerElapsed; timer.Start(); _ownTimer = new Timer(500); _ownTimer.Elapsed += OwnTimerOnElapsed; _ownTimer.AutoReset = false; _ownTimer.Start(); }
public TransactionPool(ITransactionStorage transactionStorage, IPendingTransactionThresholdValidator pendingTransactionThresholdValidator, ITimestamp timestamp, IEthereumSigner signer, ILogManager logManager, int removePendingTransactionInterval = 600, int peerNotificationThreshold = 20) { _logger = logManager?.GetClassLogger() ?? throw new ArgumentNullException(nameof(logManager)); _transactionStorage = transactionStorage; _pendingTransactionThresholdValidator = pendingTransactionThresholdValidator; _timestamp = timestamp; _signer = signer; _peerNotificationThreshold = peerNotificationThreshold; if (removePendingTransactionInterval <= 0) { return; } var timer = new Timer { Interval = removePendingTransactionInterval * 1000 }; timer.Elapsed += OnTimerElapsed; timer.Start(); }