diff --git a/netmap/netmap_contract.go b/netmap/netmap_contract.go index e4c495c..bd29daf 100644 --- a/netmap/netmap_contract.go +++ b/netmap/netmap_contract.go @@ -273,6 +273,12 @@ func Snapshot(diff int) []storageNode { return getSnapshot(ctx, key) } +func SnapshotByEpoch(epoch int) []storageNode { + currentEpoch := storage.Get(ctx, snapshotEpoch).(int) + + return Snapshot(currentEpoch - epoch) +} + func Config(key []byte) interface{} { return getConfig(ctx, key) }