mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-04 18:03:14 +02:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user