multi: fix linting errors

This commit is contained in:
Conner Fromknecht committed 2018-08-02 18:20:50 -07:00
1 parent 8beeeb1944
commit cf2c371042
18 files changed
+89 -72

No files matched your search

+2 -2
View File
@@ -10,8 +10,8 @@ import (
type unknownAddrType struct{}
func (_ unknownAddrType) Network() string { return "unknown" }
func (_ unknownAddrType) String() string { return "unknown" }
func (t unknownAddrType) Network() string { return "unknown" }
func (t unknownAddrType) String() string { return "unknown" }
var addrTests = []struct {
expAddr net.Addr
+1 -1
View File
@@ -299,7 +299,7 @@ type ChannelStatus uint8
var (
// Default is the normal state of an open channel.
Default ChannelStatus = 0
Default ChannelStatus
// Borked indicates that the channel has entered an irreconcilable
// state, triggered by a state desynchronization or channel breach.
+7 -7
View File
@@ -613,8 +613,8 @@ func (d *DB) MarkChanFullyClosed(chanPoint *wire.OutPoint) error {
// pruneLinkNode determines whether we should garbage collect a link node from
// the database due to no longer having any open channels with it. If there are
// any left, then this acts as a no-op.
func (db *DB) pruneLinkNode(tx *bolt.Tx, remotePub *btcec.PublicKey) error {
openChannels, err := db.fetchOpenChannels(tx, remotePub)
func (d *DB) pruneLinkNode(tx *bolt.Tx, remotePub *btcec.PublicKey) error {
openChannels, err := d.fetchOpenChannels(tx, remotePub)
if err != nil {
return fmt.Errorf("unable to fetch open channels for peer %x: "+
"%v", remotePub.SerializeCompressed(), err)
@@ -627,20 +627,20 @@ func (db *DB) pruneLinkNode(tx *bolt.Tx, remotePub *btcec.PublicKey) error {
log.Infof("Pruning link node %x with zero open channels from database",
remotePub.SerializeCompressed())
return db.deleteLinkNode(tx, remotePub)
return d.deleteLinkNode(tx, remotePub)
}
// PruneLinkNodes attempts to prune all link nodes found within the databse with
// whom we no longer have any open channels with.
func (db *DB) PruneLinkNodes() error {
return db.Update(func(tx *bolt.Tx) error {
linkNodes, err := db.fetchAllLinkNodes(tx)
func (d *DB) PruneLinkNodes() error {
return d.Update(func(tx *bolt.Tx) error {
linkNodes, err := d.fetchAllLinkNodes(tx)
if err != nil {
return err
}
for _, linkNode := range linkNodes {
err := db.pruneLinkNode(tx, linkNode.IdentityPub)
err := d.pruneLinkNode(tx, linkNode.IdentityPub)
if err != nil {
return err
}
+2 -2
View File
@@ -809,8 +809,8 @@ func (c *ChannelGraph) pruneGraphNodes(tx *bolt.Tx, nodes *bolt.Bucket,
// With the nodes extracted, we'll increase the ref count of
// each of the nodes.
nodeRefCounts[node1] += 1
nodeRefCounts[node2] += 1
nodeRefCounts[node1]++
nodeRefCounts[node2]++
return nil
})
+4 -4
View File
@@ -129,13 +129,13 @@ func putLinkNode(nodeMetaBucket *bolt.Bucket, l *LinkNode) error {
// DeleteLinkNode removes the link node with the given identity from the
// database.
func (d *DB) DeleteLinkNode(identity *btcec.PublicKey) error {
return d.Update(func(tx *bolt.Tx) error {
return d.deleteLinkNode(tx, identity)
func (db *DB) DeleteLinkNode(identity *btcec.PublicKey) error {
return db.Update(func(tx *bolt.Tx) error {
return db.deleteLinkNode(tx, identity)
})
}
func (d *DB) deleteLinkNode(tx *bolt.Tx, identity *btcec.PublicKey) error {
func (db *DB) deleteLinkNode(tx *bolt.Tx, identity *btcec.PublicKey) error {
nodeMetaBucket := tx.Bucket(nodeInfoBucket)
if nodeMetaBucket == nil {
return ErrLinkNodesNotFound