Example #1
0
        private void ProcessStateBlocks(CancellationToken ct)
        {
            foreach (RegistryRegisterBlock transactionRegisterBlock in _registryStateBlocks.GetConsumingEnumerable(ct))
            {
                //TODO: add logic that will check whether received Transaction Header was already stored into blockchain

                bool isNew = _registryMemPool.EnqueueTransactionWitness(transactionRegisterBlock);

                if (isNew)
                {
                    IPacketProvider packetProvider = _rawPacketProvidersFactory.Create(transactionRegisterBlock);
                    _udpCommunicationService.PostMessage(_registryGroupState.GetAllNeighbors(), packetProvider);
                }
            }
        }