Skip to content

Commit

Permalink
add code_change/4 to add the missing fields in the state
Browse files Browse the repository at this point in the history
  • Loading branch information
bchamagne committed Dec 19, 2023
1 parent 2fbba9e commit fe9ae2a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/archethic/p2p/client/connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,16 @@ defmodule Archethic.P2P.Client.Connection do
:ets.delete(@table_name, node_public_key)
end

def code_change("1.4.2", state, data, _extra) do
{:ok, state,
data
|> Map.merge(%{
reconnect_attempts: 0,
heartbeats_sent: 0,
heartbeats_received: 0
})}
end

def code_change(_old_vsn, state, data, _extra), do: {:ok, state, data}

defp backoff(attempts) do
Expand Down

0 comments on commit fe9ae2a

Please sign in to comment.