daemon --import-snapshot: force head silently, without triggering reorg.

This commit is contained in:
Raúl Kripalani 2020-11-16 16:03:47 +00:00
parent d7b4f92f1f
commit bac51dd4e3
2 changed files with 2 additions and 2 deletions

View File

@ -382,7 +382,7 @@ func (cs *ChainStore) MaybeTakeHeavierTipSet(ctx context.Context, ts *types.TipS
// particular tipset to carry out a benchmark, verification, etc. on a chain
// segment.
func (cs *ChainStore) ForceHeadSilent(_ context.Context, ts *types.TipSet) error {
log.Warnf("(!!!) forcing a new head silently; only use this only for testing; new head: %s", ts)
log.Warnf("(!!!) forcing a new head silently; new head: %s", ts)
cs.heaviestLk.Lock()
defer cs.heaviestLk.Unlock()

View File

@ -467,7 +467,7 @@ func ImportChain(r repo.Repo, fname string, snapshot bool) (err error) {
}
log.Infof("accepting %s as new head", ts.Cids())
if err := cst.SetHead(ts); err != nil {
if err := cst.ForceHeadSilent(ctx, ts); err != nil {
return err
}