don't sleep if no block mined
This commit is contained in:
parent
719f20d091
commit
a6f6674468
@ -164,12 +164,12 @@ func (m *Miner) mine(ctx context.Context) {
|
||||
continue
|
||||
}
|
||||
|
||||
if b != nil {
|
||||
btime := time.Unix(int64(b.Header.Timestamp), 0)
|
||||
if time.Now().Before(btime) {
|
||||
time.Sleep(time.Until(btime))
|
||||
}
|
||||
|
||||
if b != nil {
|
||||
if err := m.api.ChainSubmitBlock(ctx, b); err != nil {
|
||||
log.Errorf("failed to submit newly mined block: %s", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user