mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 19:03:16 +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
|
// FetchChannel attempts to locate a channel specified by the passed channel
|
||||||
// point. If the channel cannot be found, then an error will be returned.
|
// 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
|
// Optionally an existing db tx can be supplied.
|
||||||
// can be supplied.
|
|
||||||
func (c *ChannelStateDB) FetchChannel(tx kvdb.RTx, chanPoint wire.OutPoint) (
|
func (c *ChannelStateDB) FetchChannel(tx kvdb.RTx, chanPoint wire.OutPoint) (
|
||||||
*OpenChannel, error) {
|
*OpenChannel, error) {
|
||||||
|
|
||||||
@@ -694,7 +693,9 @@ func (c *ChannelStateDB) FetchChannel(tx kvdb.RTx, chanPoint wire.OutPoint) (
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeChanBucket := openChanBucket.NestedReadBucket(nodePub)
|
nodeChanBucket := openChanBucket.NestedReadBucket(
|
||||||
|
nodePub,
|
||||||
|
)
|
||||||
if nodeChanBucket == nil {
|
if nodeChanBucket == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -715,10 +716,11 @@ func (c *ChannelStateDB) FetchChannel(tx kvdb.RTx, chanPoint wire.OutPoint) (
|
|||||||
)
|
)
|
||||||
if chainBucket == nil {
|
if chainBucket == nil {
|
||||||
return fmt.Errorf("unable to read "+
|
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.
|
// all the chanPoints for this node.
|
||||||
chanBucket := chainBucket.NestedReadBucket(
|
chanBucket := chainBucket.NestedReadBucket(
|
||||||
targetChanPoint.Bytes(),
|
targetChanPoint.Bytes(),
|
||||||
|
Reference in New Issue
Block a user