From f631e65699d733e246fef4c42af7445b34f2190e Mon Sep 17 00:00:00 2001 From: weiihann Date: Tue, 19 Nov 2024 10:26:42 +0800 Subject: [PATCH] refactor isExpired --- epoch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epoch.go b/epoch.go index 0a2c184..6ec6602 100644 --- a/epoch.go +++ b/epoch.go @@ -11,7 +11,7 @@ const ( ) func IsExpired(prev StatePeriod, cur StatePeriod) bool { - return cur-prev >= NumActiveEpochs + return cur >= prev+NumActiveEpochs // TODO(weiihann): deal with overflow } func StatePeriodFromBytes(b []byte) StatePeriod {