fix(lotus-sim): obey context in walk

This commit is contained in:
Steven Allen 2021-06-10 09:54:14 -07:00
parent ca9eadd7c7
commit 68593ce995

View File

@ -297,7 +297,7 @@ func (sim *Simulation) Walk(
if err != nil {
return err
}
for !ts.Equals(sim.start) {
for !ts.Equals(sim.start) && ctx.Err() == nil {
msgs, err := sim.Chainstore.MessagesForTipset(ts)
if err != nil {
return err
@ -331,5 +331,5 @@ func (sim *Simulation) Walk(
return xerrors.Errorf("loading parent: %w", err)
}
}
return nil
return ctx.Err()
}