mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-03 10:12:28 +02:00
channeldb: lint FetchChannel method
A few lint fixes of the FetchChannel method.
This commit is contained in:
@@ -654,8 +654,7 @@ func (c *ChannelStateDB) fetchNodeChannels(chainBucket kvdb.RBucket) (
|
||||
|
||||
// FetchChannel attempts to locate a channel specified by the passed channel
|
||||
// point. If the channel cannot be found, then an error will be returned.
|
||||
// Optionally an existing db tx can be supplied. Optionally an existing db tx
|
||||
// can be supplied.
|
||||
// Optionally an existing db tx can be supplied.
|
||||
func (c *ChannelStateDB) FetchChannel(tx kvdb.RTx, chanPoint wire.OutPoint) (
|
||||
*OpenChannel, error) {
|
||||
|
||||
@@ -694,7 +693,9 @@ func (c *ChannelStateDB) FetchChannel(tx kvdb.RTx, chanPoint wire.OutPoint) (
|
||||
return nil
|
||||
}
|
||||
|
||||
nodeChanBucket := openChanBucket.NestedReadBucket(nodePub)
|
||||
nodeChanBucket := openChanBucket.NestedReadBucket(
|
||||
nodePub,
|
||||
)
|
||||
if nodeChanBucket == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -715,10 +716,11 @@ func (c *ChannelStateDB) FetchChannel(tx kvdb.RTx, chanPoint wire.OutPoint) (
|
||||
)
|
||||
if chainBucket == nil {
|
||||
return fmt.Errorf("unable to read "+
|
||||
"bucket for chain=%x", chainHash[:])
|
||||
"bucket for chain=%x",
|
||||
chainHash)
|
||||
}
|
||||
|
||||
// Finally we reach the leaf bucket that stores
|
||||
// Finally, we reach the leaf bucket that stores
|
||||
// all the chanPoints for this node.
|
||||
chanBucket := chainBucket.NestedReadBucket(
|
||||
targetChanPoint.Bytes(),
|
||||
@@ -757,7 +759,7 @@ func (c *ChannelStateDB) FetchChannel(tx kvdb.RTx, chanPoint wire.OutPoint) (
|
||||
}
|
||||
|
||||
// If we can't find the channel, then we return with an error, as we
|
||||
// have nothing to backup.
|
||||
// have nothing to back up.
|
||||
return nil, ErrChannelNotFound
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user