pull/2255/head
Ayrat Badykov 5 years ago
parent 2af8cd8f25
commit 0a13e0225b
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 16
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/rolling_window.ex

@ -211,12 +211,16 @@ defmodule EthereumJSONRPC.RollingWindow do
""" """
@spec inspect(table :: atom, key :: term()) :: nonempty_list(non_neg_integer) @spec inspect(table :: atom, key :: term()) :: nonempty_list(non_neg_integer)
def inspect(table, key) do def inspect(table, key) do
case :ets.lookup(table, key) do if :ets.whereis(table) == :undefined do
[{_, current_window, windows}] -> []
[current_window | windows] else
case :ets.lookup(table, key) do
_ -> [{_, current_window, windows}] ->
[] [current_window | windows]
_ ->
[]
end
end end
end end
end end

Loading…
Cancel
Save