diff --git a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/EthGetTransactionByHash.java b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/EthGetTransactionByHash.java index f3b7974f1f..e3a838f5e3 100644 --- a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/EthGetTransactionByHash.java +++ b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/EthGetTransactionByHash.java @@ -59,13 +59,9 @@ public JsonRpcResponse response(final JsonRpcRequest request) { } private Object getResult(final Hash hash) { - final Optional transactionCompleteResult = - blockchain.transactionByHash(hash).map(TransactionCompleteResult::new); - return transactionCompleteResult.orElseGet( - () -> - pendingTransactions - .getTransactionByHash(hash) - .map(TransactionPendingResult::new) - .orElse(null)); + final Optional transactionPendingResult = + pendingTransactions.getTransactionByHash(hash).map(TransactionPendingResult::new); + return transactionPendingResult.orElseGet( + () -> blockchain.transactionByHash(hash).map(TransactionCompleteResult::new).orElse(null)); } }