コード例 #1
0
        private void OnBlockAddedToMain(object sender, BlockReplacementEventArgs e)
        {
            _receiptStorage.EnsureCanonical(e.Block);

            // we don't want this to be on main processing thread
            Task.Run(() => TriggerReceiptInsertedEvent(e.Block, e.PreviousBlock));
        }
コード例 #2
0
 private void OnBlockAddedToMain(object sender, BlockReplacementEventArgs e)
 {
     // we don't want this to be on main processing thread
     Task.Run(() => ProcessBlock(e.Block, e.PreviousBlock))
     .ContinueWith(t =>
     {
         if (t.IsFaulted)
         {
             if (_logger.IsError)
             {
                 _logger.Error($"Couldn't correctly add or remove transactions from txpool after processing block {e.Block.ToString(Block.Format.FullHashAndNumber)}.", t.Exception);
             }
         }
     });
 }
コード例 #3
0
 private void OnBlockAddedToMain(object sender, BlockReplacementEventArgs e)
 {
     // we don't want this to be on main processing thread
     Task.Run(() => RollbackReceipts(e.PreviousBlock))
     .ContinueWith(t =>
     {
         if (t.IsFaulted)
         {
             if (_logger.IsError)
             {
                 _logger.Error($"Couldn't correctly insert updated receipts from removed block {e.PreviousBlock?.ToString(Block.Format.FullHashAndNumber)} to receipt storage.", t.Exception);
             }
         }
     });
 }
コード例 #4
0
 private void OnHeadChanged(object?sender, BlockReplacementEventArgs e)
 {
     BlockGasLimit  = e.Block !.GasLimit;
     CurrentBaseFee = e.Block.Header.BaseFeePerGas;
     HeadChanged?.Invoke(sender, e);
 }