anchor.diff:  -define(INITIAL_RENEWAL_INTERVAL, timer:seconds(2)).
   -define(RENEWAL_INTERVAL_INCREASE_RATE, 2).
   % timer:minutes(15) - defined like that to use in patter matching
  --define(MAX_RENEWAL_INTERVAL, 3600000).
  +-define(MAX_RENEWAL_INTERVAL, 900000).
   
   -define(RENEW_CONNECTIONS_REQ, renew_connections).
   -define(SUCCESSFUL_HANDSHAKE, handshake_succeeded).
  
positive.code: log_error(State, throw, {cannot_verify_peer_op_identity, Reason}) ->
      ?warning("Discarding connections renewal to provider ~ts because "
               "its identity cannot be verified due to ~p. ~n"
               "Next retry not sooner than ~p s. ~n", [
          provider_logic:to_printable(State#state.peer_id),
          Reason,
          State#state.renewal_interval / 1000
  
negative.code: %% @end
  %%--------------------------------------------------------------------
  -spec renew_connections(state()) -> {ok, state()} | {error, peer_offline}.
  renew_connections(#state{
      renewal_timer = undefined,
      renewal_interval = Interval
  } = State) ->
      NewState = try
          renew_connections_insecure(State)
      catch Type:Reason ->
          log_error(State, Type, Reason),
          schedule_next_renewal(State)
      end,
  
      case NewState of
          #state{renewal_timer = undefined} ->
              {ok, NewState};
          #state{connections = Cons} when map_size(Cons) > 0 ->
              {ok, NewState};
          _ when not (Interval > ?MAX_RENEWAL_INTERVAL) ->   % not last retry
              {ok, NewState};
          _ ->
              {error, peer_offline}
      end;
  renew_connections(State) ->
      {ok, State}.
  