Signature changes.

This commit is contained in:
Thomas E Lackey 2023-09-29 15:55:03 -05:00
parent 18f376fb6e
commit c7ccdf3b3d

View File

@ -220,17 +220,16 @@ func (v *Validator) iterate(it trie.NodeIterator, storage bool) error {
// Traverses each iterator in a separate goroutine. // Traverses each iterator in a separate goroutine.
// Dumps to a recovery file on failure or interrupt. // Dumps to a recovery file on failure or interrupt.
func iterateTracked(tree state.Trie, recoveryFile string, iterCount uint, fn func(trie.NodeIterator) error) error { 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 := tracker.New(recoveryFile, iterCount)
tracker.CaptureSignal(cancelCtx)
halt := func() { halt := func() {
if err := tracker.HaltAndDump(); err != nil { if err := tracker.CloseAndSave(); err != nil {
log.Errorf("failed to write recovery file: %v", err) log.Errorf("failed to write recovery file: %v", err)
} }
} }
// attempt to restore from recovery file if it exists // attempt to restore from recovery file if it exists
iters, err := tracker.Restore(tree.NodeIterator) iters, _, err := tracker.Restore(tree.NodeIterator)
if err != nil { if err != nil {
return err return err
} }