[#132] Add cleanup table in netmap processor

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-10-29 18:57:55 +03:00 committed by Alex Vanin
parent 9b97e95f82
commit 0c42db2c3c
3 changed files with 16 additions and 12 deletions

View file

@ -38,17 +38,21 @@ type (
epochState EpochState
activeState ActiveState
morphClient *client.Client
netmapSnapshot cleanupTable
}
// Params of the processor constructor.
Params struct {
Log *zap.Logger
PoolSize int
NetmapContract util.Uint160
EpochTimer EpochTimerReseter
MorphClient *client.Client
EpochState EpochState
ActiveState ActiveState
Log *zap.Logger
PoolSize int
NetmapContract util.Uint160
EpochTimer EpochTimerReseter
MorphClient *client.Client
EpochState EpochState
ActiveState ActiveState
CleanupEnabled bool
CleanupThreshold uint64 // in epochs
}
)
@ -88,6 +92,7 @@ func New(p *Params) (*Processor, error) {
epochState: p.EpochState,
activeState: p.ActiveState,
morphClient: p.MorphClient,
netmapSnapshot: newCleanupTable(p.CleanupEnabled, p.CleanupThreshold),
}, nil
}