mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-12 09:52: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:
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
|
// Get the bucket dedicated to storing the meta-data for open
|
||||||
// channels.
|
// channels.
|
||||||
openChanBucket := tx.Bucket(openChannelBucket)
|
openChanBucket := tx.Bucket(openChannelBucket)
|
||||||
if openChannelBucket == nil {
|
if openChanBucket == nil {
|
||||||
return fmt.Errorf("open channel bucket does not exist")
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Within this top level bucket, fetch the bucket dedicated to storing
|
// Within this top level bucket, fetch the bucket dedicated to storing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user