Skip to content

Commit f30b218

Browse files
committed
Fix revokes per epoch counting (#426)
1 parent f09e181 commit f30b218

File tree

1 file changed

+4
-3
lines changed
  • framework/libra-framework/sources/ol_sources/vouch_lib

1 file changed

+4
-3
lines changed

framework/libra-framework/sources/ol_sources/vouch_lib/vouch.move

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,11 +375,12 @@ module ol_framework::vouch {
375375

376376
// lazy update counter
377377
if (current_epoch > lifetime.last_revocation_epoch) {
378+
// If this is a new epoch vs the last revoke, reset the per-epoch count
378379
lifetime.last_revocation_epoch = current_epoch;
379-
lifetime.revocations_this_epoch = lifetime.revocations_this_epoch + 1;
380-
380+
lifetime.revocations_this_epoch = 1;
381381
} else {
382-
lifetime.revocations_this_epoch =1;
382+
// Otherwise, increment the revoke count for the current epoch
383+
lifetime.revocations_this_epoch = lifetime.revocations_this_epoch + 1;
383384
}
384385

385386
}

0 commit comments

Comments
 (0)