From 4590364d044b7d3eb217feb2efb34bbc89e6f3bc Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sat, 9 Jul 2016 16:19:18 -0700 Subject: [PATCH] channeldb: return nil for error if openChanBucket not created This avoids an unnecessary panic in the case that the channeldb has been wiped independently while a new peer connects. --- channeldb/db.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/channeldb/db.go b/channeldb/db.go index 7f15d3af..926a922f 100644 --- a/channeldb/db.go +++ b/channeldb/db.go @@ -150,8 +150,8 @@ func (d *DB) FetchOpenChannels(nodeID *wire.ShaHash) ([]*OpenChannel, error) { // Get the bucket dedicated to storing the meta-data for open // channels. openChanBucket := tx.Bucket(openChannelBucket) - if openChannelBucket == nil { - return fmt.Errorf("open channel bucket does not exist") + if openChanBucket == nil { + return nil } // Within this top level bucket, fetch the bucket dedicated to storing