Method: Reth::JSONRPC::Handler#handle_eth_getTransactionByHash

Defined in:
lib/reth/jsonrpc/handler.rb

#handle_eth_getTransactionByHash(txhash) ⇒ Object



178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/reth/jsonrpc/handler.rb', line 178

def handle_eth_getTransactionByHash(txhash)
  tx, block, index = @node.state.chain.index.get_transaction hex_to_bytes(txhash)

  if @node.state.chain.in_main_branch?(block)
    encode_tx tx, block, index, false
  else
    nil
  end
rescue IndexError
  puts $!
  puts $!.backtrace.join("\n")
  nil
end