[#33] netmap: Do not save ballots for invalid epoch

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
enable-notary-in-public-chains
Alex Vanin 2020-12-25 14:45:24 +03:00 committed by Alex Vanin
parent 76f5943c14
commit 6abe334676
1 changed files with 5 additions and 0 deletions

View File

@ -219,6 +219,11 @@ func NewEpoch(epochNum int) bool {
panic("newEpoch: this method must be invoked by inner ring nodes")
}
currentEpoch := storage.Get(ctx, snapshotEpoch).(int)
if epochNum <= currentEpoch {
return false // ignore invocations with invalid epoch
}
data0snapshot := getSnapshot(ctx, snapshot0Key)
dataOnlineState := filterNetmap(ctx, onlineState)