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.
This commit is contained in:
parent
40d9f0da31
commit
4590364d04
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user