Update to plugeth-statediff 0.1.4 #2
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user
What's the replacement scheme for CaptureSignal()?
it was such a simple function, I just removed it from the package.
But the context doesn't really do anything here (and never did), we need to add a bit more plumbing.
So is the "fix" of just dropping the line appropriate at the moment?
Yes, it can wait
I made a follow up PR. Also need to fix it for snapshots cerc-io/ipld-eth-state-snapshot#2