miner: Log late blocks

This commit is contained in:
Łukasz Magiera 2019-10-10 02:20:47 +02:00
parent 0c6fcde9c4
commit 3fd2f3da7a

View File

@ -170,6 +170,8 @@ func (m *Miner) mine(ctx context.Context) {
btime := time.Unix(int64(b.Header.Timestamp), 0)
if time.Now().Before(btime) {
time.Sleep(time.Until(btime))
} else {
log.Warnf("Mined block in the past: b.T: %s, T: %s, dT: %s", btime, time.Now(), time.Now().Sub(btime))
}
if err := m.api.ChainSubmitBlock(ctx, b); err != nil {