diff --git a/channeldb/codec.go b/channeldb/codec.go index e693739b..78d61694 100644 --- a/channeldb/codec.go +++ b/channeldb/codec.go @@ -76,6 +76,7 @@ func WriteElement(w io.Writer, element interface{}) error { if e.PubKey != nil { if err := binary.Write(w, byteOrder, true); err != nil { + return fmt.Errorf("error writing serialized element: %s", err) } return WriteElement(w, e.PubKey) diff --git a/channeldb/migrations.go b/channeldb/migrations.go index e009d833..a78d1314 100644 --- a/channeldb/migrations.go +++ b/channeldb/migrations.go @@ -515,6 +515,9 @@ func migratePruneEdgeUpdateIndex(tx *bbolt.Tx) error { // already exist given the assumption that the buckets above do as // well. edgeIndex, err := edges.CreateBucketIfNotExists(edgeIndexBucket) + if err != nil { + return fmt.Errorf("error creating edge index bucket: %s", err) + } if edgeIndex == nil { return fmt.Errorf("unable to create/fetch edge index " + "bucket") diff --git a/channeldb/migrations_test.go b/channeldb/migrations_test.go index 3627f142..93bf602f 100644 --- a/channeldb/migrations_test.go +++ b/channeldb/migrations_test.go @@ -839,6 +839,9 @@ func TestPaymentRouteSerialization(t *testing.T) { payHashBucket, err = paymentsBucket.CreateBucket( payInfo.PaymentHash[:], ) + if err != nil { + t.Fatalf("unable to create payments bucket: %v", err) + } } else { payHashBucket = paymentsBucket.Bucket( payInfo.PaymentHash[:], diff --git a/channeldb/waitingproof_test.go b/channeldb/waitingproof_test.go index 2f8a64b0..fff52b92 100644 --- a/channeldb/waitingproof_test.go +++ b/channeldb/waitingproof_test.go @@ -16,7 +16,7 @@ func TestWaitingProofStore(t *testing.T) { db, cleanup, err := makeTestDB() if err != nil { - + t.Fatalf("failed to make test database: %s", err) } defer cleanup()