Skip to content

Commit 1e807f6

Browse files
committed
Skip nil buckets in compactdb
1 parent 4f343dd commit 1e807f6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

cmd/chantools/compactdb.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ type walkFunc func(keys [][]byte, k, v []byte, seq uint64) error
143143
func (c *compactDBCommand) walk(db *bbolt.DB, walkFn walkFunc) error {
144144
return db.View(func(tx *bbolt.Tx) error {
145145
return tx.ForEach(func(name []byte, b *bbolt.Bucket) error {
146+
if b == nil {
147+
log.Errorf("Bucket %x was nil! Probable data "+
148+
"corruption suspected.", name)
149+
return nil
150+
}
146151
return c.walkBucket(
147152
b, nil, name, nil, b.Sequence(), walkFn,
148153
)

cmd/chantools/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323

2424
const (
2525
defaultAPIURL = "https://blockstream.info/api"
26-
version = "0.5.0"
26+
version = "0.5.1"
2727
)
2828

2929
var (

0 commit comments

Comments
 (0)