Skip to content

Commit

Permalink
Skip nil buckets in compactdb
Browse files Browse the repository at this point in the history
  • Loading branch information
guggero committed Sep 8, 2020
1 parent 4f343dd commit 1e807f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cmd/chantools/compactdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ type walkFunc func(keys [][]byte, k, v []byte, seq uint64) error
func (c *compactDBCommand) walk(db *bbolt.DB, walkFn walkFunc) error {
return db.View(func(tx *bbolt.Tx) error {
return tx.ForEach(func(name []byte, b *bbolt.Bucket) error {
if b == nil {
log.Errorf("Bucket %x was nil! Probable data "+
"corruption suspected.", name)
return nil
}
return c.walkBucket(
b, nil, name, nil, b.Sequence(), walkFn,
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/chantools/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

const (
defaultAPIURL = "https://blockstream.info/api"
version = "0.5.0"
version = "0.5.1"
)

var (
Expand Down

0 comments on commit 1e807f6

Please sign in to comment.