diff --git a/chain/sync.go b/chain/sync.go index 0a3aace6d..d81adb9f6 100644 --- a/chain/sync.go +++ b/chain/sync.go @@ -103,7 +103,7 @@ func (syncer *Syncer) InformNewHead(from peer.ID, fts *store.FullTipSet) { log.Info("got block from ourselves") if err := syncer.Sync(fts.TipSet()); err != nil { - log.Errorf("failed to sync our own block: %+v", err) + log.Errorf("failed to sync our own block %s: %+v", fts.TipSet().Cids(), err) } return diff --git a/miner/miner.go b/miner/miner.go index 4196ae405..f69d124dd 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -131,6 +131,8 @@ func (m *Miner) mine(ctx context.Context) { ctx, span := trace.StartSpan(ctx, "/mine") defer span.End() + var lastBase *types.TipSet + for { select { case <-m.stop: @@ -157,6 +159,12 @@ func (m *Miner) mine(ctx context.Context) { log.Errorf("failed to get best mining candidate: %s", err) continue } + if base.ts.Equals(lastBase) { + log.Error("BestMiningCandidate from the previous round: %s", lastBase.Cids()) + time.Sleep(build.BlockDelay) + continue + } + lastBase = base.ts b, err := m.mineOne(ctx, base) if err != nil {