From c7ccdf3b3d3b24b6673e5a3ccfcc6aeb0ed0702a Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Fri, 29 Sep 2023 15:55:03 -0500 Subject: [PATCH] Signature changes. --- pkg/validator.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/validator.go b/pkg/validator.go index ed64963..52d94a4 100644 --- a/pkg/validator.go +++ b/pkg/validator.go @@ -220,17 +220,16 @@ func (v *Validator) iterate(it trie.NodeIterator, storage bool) error { // Traverses each iterator in a separate goroutine. // Dumps to a recovery file on failure or interrupt. func iterateTracked(tree state.Trie, recoveryFile string, iterCount uint, fn func(trie.NodeIterator) error) error { - ctx, cancelCtx := context.WithCancel(context.Background()) + ctx, _ := context.WithCancel(context.Background()) tracker := tracker.New(recoveryFile, iterCount) - tracker.CaptureSignal(cancelCtx) halt := func() { - if err := tracker.HaltAndDump(); err != nil { + if err := tracker.CloseAndSave(); err != nil { log.Errorf("failed to write recovery file: %v", err) } } // attempt to restore from recovery file if it exists - iters, err := tracker.Restore(tree.NodeIterator) + iters, _, err := tracker.Restore(tree.NodeIterator) if err != nil { return err }