From aebdd2375ca6e66037e121b68b2731449b13a419 Mon Sep 17 00:00:00 2001 From: Elle Mouton Date: Thu, 2 Feb 2023 10:56:15 +0200 Subject: [PATCH] channeldb: lint FetchChannel method A few lint fixes of the FetchChannel method. --- channeldb/db.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/channeldb/db.go b/channeldb/db.go index 38493d240..7c204375b 100644 --- a/channeldb/db.go +++ b/channeldb/db.go @@ -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 }