Exemplo n.º 1
0
 private void RecoverTxSenderIfNeeded(Transaction transaction)
 {
     if (transaction.SenderAddress == null)
     {
         _blockchainBridge.RecoverTxSender(transaction);
     }
 }
Exemplo n.º 2
0
        public ResultWrapper <TransactionForRpc> eth_getTransactionByHash(Keccak transactionHash)
        {
            (TxReceipt receipt, Transaction transaction) = _blockchainBridge.GetTransaction(transactionHash);
            if (transaction == null)
            {
                return(ResultWrapper <TransactionForRpc> .Success(null));
            }

            _blockchainBridge.RecoverTxSender(transaction, receipt.BlockNumber);
            var transactionModel = new TransactionForRpc(receipt.BlockHash, receipt.BlockNumber, receipt.Index, transaction);

            if (_logger.IsTrace)
            {
                _logger.Trace($"eth_getTransactionByHash request {transactionHash}, result: {transactionModel.Hash}");
            }
            return(ResultWrapper <TransactionForRpc> .Success(transactionModel));
        }
Exemplo n.º 3
0
        public ResultWrapper <TransactionForRpc> eth_getTransactionByHash(Keccak transactionHash)
        {
            try
            {
                _readerWriterLockSlim.EnterReadLock();
                (TxReceipt receipt, Transaction transaction) = _blockchainBridge.GetTransaction(transactionHash);
                if (transaction == null)
                {
                    return(ResultWrapper <TransactionForRpc> .Success(null));
                }

                _blockchainBridge.RecoverTxSender(transaction, receipt.BlockNumber);
                var transactionModel = new TransactionForRpc(receipt.BlockHash, receipt.BlockNumber, receipt.Index, transaction);
                if (Logger.IsTrace)
                {
                    Logger.Trace($"eth_getTransactionByHash request {transactionHash}, result: {transactionModel.Hash}");
                }
                return(ResultWrapper <TransactionForRpc> .Success(transactionModel));
            }
            finally
            {
                _readerWriterLockSlim.ExitReadLock();
            }
        }