Пример #1
0
        public void Process(Transaction tx)
        {
            lock (ProcessedLock)
            {
                if (ProcessedTransactionHashes.Add(tx.GetHash()))
                {
                    TransactionReceived?.Invoke(this, new SmartTransaction(tx, Height.Mempool));
                }
                else
                {
                    Interlocked.Increment(ref _duplicatedReceives);
                }

                Interlocked.Increment(ref _totalReceives);
            }
        }
Пример #2
0
        public void Process(Transaction tx)
        {
            SmartTransaction txAdded = null;

            lock (ProcessedLock)
            {
                if (ProcessedTransactionHashes.Add(tx.GetHash()))
                {
                    txAdded = new SmartTransaction(tx, Height.Mempool);
                }
                else
                {
                    Interlocked.Increment(ref _duplicatedReceives);
                }
                Interlocked.Increment(ref _totalReceives);
            }
            if (txAdded is { })