示例#1
0
        public TxCompletion(
            BlockChain <TAction> blockChain,
            TxFetcher txFetcher,
            TxBroadcaster txBroadcaster)
        {
            _txSyncTasks             = new ConcurrentDictionary <TPeer, Task>();
            _requiredTxIds           = new ConcurrentDictionary <TPeer, ConcurrentBag <TxId> >();
            _cancellationTokenSource = new CancellationTokenSource();
            _blockChain    = blockChain;
            _txFetcher     = txFetcher;
            _txBroadcaster = txBroadcaster;
            TxReceived     = new AsyncAutoResetEvent();

            _logger = Log.ForContext <TxCompletion <TPeer, TAction> >();
        }
示例#2
0
        public TxCompletion(
            BlockChain <TAction> blockChain,
            TxFetcher txFetcher,
            TxBroadcaster txBroadcaster)
        {
            _cancellationTokenSource = new CancellationTokenSource();
            _blockChain    = blockChain;
            _txFetcher     = txFetcher;
            _txBroadcaster = txBroadcaster;
            TxReceived     = new AsyncAutoResetEvent();

            _logger = Log
                      .ForContext <TxCompletion <TPeer, TAction> >()
                      .ForContext("Source", nameof(TxCompletion <TPeer, TAction>));
        }