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

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-12-25 14:45:24 +03:00 committed by Alex Vanin
parent 76f5943c14
commit 6abe334676

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)