lnd: fix latest goclean.sh lint warning

This commit is contained in:
Andrey Samokhvalov
2017-03-09 07:44:32 +03:00
committed by Olaoluwa Osuntokun
parent 730c0b8cb1
commit 61991a1c89
16 changed files with 44 additions and 88 deletions

View File

@@ -1453,7 +1453,7 @@ func putChanFundingInfo(nodeChanBucket *bolt.Bucket, channel *OpenChannel) error
return err
}
byteOrder.PutUint16(scratch[:2], uint16(channel.NumConfsRequired))
byteOrder.PutUint16(scratch[:2], channel.NumConfsRequired)
if _, err := b.Write(scratch[:2]); err != nil {
return err
}

View File

@@ -346,7 +346,7 @@ func fetchChannels(d *DB, pendingOnly bool) ([]*OpenChannel, error) {
}
if pendingOnly {
for _, channel := range nodeChannels {
if channel.IsPending == true {
if channel.IsPending {
channels = append(channels, channel)
}
}
@@ -363,7 +363,7 @@ func fetchChannels(d *DB, pendingOnly bool) ([]*OpenChannel, error) {
// MarkChannelAsOpen records the finalization of the funding process and marks
// a channel as available for use.
func (d *DB) MarkChannelAsOpen(outpoint *wire.OutPoint) error {
err := d.Update(func(tx *bolt.Tx) error {
return d.Update(func(tx *bolt.Tx) error {
openChanBucket := tx.Bucket(openChannelBucket)
if openChanBucket == nil {
return ErrNoActiveChannels
@@ -385,11 +385,6 @@ func (d *DB) MarkChannelAsOpen(outpoint *wire.OutPoint) error {
byteOrder.PutUint16(scratch, uint16(0))
return openChanBucket.Put(keyPrefix, scratch)
})
if err != nil {
return err
}
return nil
}
// syncVersions function is used for safe db version synchronization. It applies

View File

@@ -751,8 +751,8 @@ func delChannelByEdge(edges *bolt.Bucket, edgeIndex *bolt.Bucket,
// updated, otherwise it's the second node's information. The node ordering is
// determined tby the lexicographical ordering of the identity public keys of
// the nodes on either side of the channel.
func (r *ChannelGraph) UpdateEdgePolicy(edge *ChannelEdgePolicy) error {
return r.db.Update(func(tx *bolt.Tx) error {
func (c *ChannelGraph) UpdateEdgePolicy(edge *ChannelEdgePolicy) error {
return c.db.Update(func(tx *bolt.Tx) error {
edges, err := tx.CreateBucketIfNotExists(edgeBucket)
if err != nil {
return err