Skip to content

Commit

Permalink
Make sure we rotate VDF servers on uninformative updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Lev Berman authored and JamesPiechota committed May 18, 2024
1 parent bd2c835 commit f7fe12c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions apps/arweave/src/ar_nonce_limiter_client.erl
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ fetch_and_apply_session_and_previous_session(Peer) ->
case ar_http_iface_client:get_previous_vdf_session(Peer) of
{ok, #nonce_limiter_update{ session_key = PrevSessionKey } = Update2} ->
ar_nonce_limiter:apply_external_update(Update2, Peer),
ar_nonce_limiter:apply_external_update(Update, Peer),
ok;
ar_nonce_limiter:apply_external_update(Update, Peer);
{ok, _} ->
%% The session should have just changed, retry.
fetch_and_apply_session_and_previous_session(Peer);
Expand All @@ -170,8 +169,7 @@ fetch_and_apply_session_and_previous_session(Peer) ->
fetch_and_apply_session(Peer) ->
case ar_http_iface_client:get_vdf_session(Peer) of
{ok, Update} ->
ar_nonce_limiter:apply_external_update(Update, Peer),
ok;
ar_nonce_limiter:apply_external_update(Update, Peer);
not_found ->
not_found;
{error, Reason} = Error ->
Expand Down

0 comments on commit f7fe12c

Please sign in to comment.