Exemplo n.º 1
0
 private void ValidateTxs(Block block, BlockHeader parentHeader)
 {
     for (int i = 0; i < block.Transactions.Length; i++)
     {
         var tx = block.Transactions[i];
         if (!_txFilter.IsAllowed(tx, parentHeader))
         {
             if (_logger.IsError)
             {
                 _logger.Error($"Proposed block is not valid {block.ToString(Block.Format.FullHashAndNumber)}. {tx.ToShortString()} doesn't have required permissions.");
             }
             throw new InvalidBlockException(block.Hash);
         }
     }
 }
Exemplo n.º 2
0
 public IEnumerable <Transaction> GetTransactions(BlockHeader parent, long gasLimit) =>
 _innerSource.GetTransactions(parent, gasLimit).Where(tx => _txPermissionFilter.IsAllowed(tx, parent));