Fix clique snapshot err check (#2115)

* save

* save

* save

* save
This commit is contained in:
Alex Sharov 2021-06-07 18:00:38 +07:00 committed by GitHub
parent c2c63a3715
commit ccc028daf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,7 @@ import (
"bytes"
"context"
"errors"
"fmt"
"sort"
"time"
@ -121,9 +122,9 @@ func lastSnapshot(db ethdb.RwKV) (uint64, error) {
lastEnc, err := tx.GetOne(dbutils.CliqueLastSnapshotBucket, LastSnapshotKey())
if err != nil {
if !errors.Is(err, ethdb.ErrKeyNotFound) {
log.Error("can't check last snapshot", "err", err)
}
return 0, fmt.Errorf("failed check last clique snapshot: %d", err)
}
if len(lastEnc) == 0 {
return 0, ErrNotFound
}