Skip to content

Commit

Permalink
Fix: Ensure to get always last VRF message in the case that exists mo…
Browse files Browse the repository at this point in the history
…re than 1.

Co-authored-by: Andres D. Molins <nesitor@gmail.com>
  • Loading branch information
nesitor and Andres D. Molins authored Jan 31, 2024
1 parent 8ffda9e commit bcc8c47
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/aleph_vrf/coordinator/vrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,9 @@ async def get_existing_vrf_message(
if messages.messages:
if len(messages.messages) > 1:
logger.warning(f"Multiple VRF messages found for request id {request_id}")
return messages.messages[0]
return messages.messages[
-1
] # Always fetch the last VRF message in case there is more than 1.
else:
logger.debug(f"Existing VRF message for request id {request_id} not found")
return None
Expand Down

0 comments on commit bcc8c47

Please sign in to comment.