From fae307e5a212533419ed2f136742156cef323c16 Mon Sep 17 00:00:00 2001 From: Shay Zluf Date: Mon, 20 Apr 2020 19:11:53 +0300 Subject: [PATCH] Fix slasher historic attestation detection (#5532) * fix slasher historic attestation detection * revert log changes --- slasher/detection/service.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/slasher/detection/service.go b/slasher/detection/service.go index 5bc2ee14a..683e869b5 100644 --- a/slasher/detection/service.go +++ b/slasher/detection/service.go @@ -137,10 +137,10 @@ func (ds *Service) detectHistoricalChainData(ctx context.Context) { } ds.submitAttesterSlashings(ctx, slashings) } - } - - if err := ds.slasherDB.SaveChainHead(ctx, currentChainHead); err != nil { - log.WithError(err).Error("Could not persist chain head to disk") + latestStoredHead = ðpb.ChainHead{HeadEpoch: epoch} + if err := ds.slasherDB.SaveChainHead(ctx, latestStoredHead); err != nil { + log.WithError(err).Error("Could not persist chain head to disk") + } } log.Infof("Completed slashing detection on historical chain data up to epoch %d", currentChainHead.HeadEpoch) }