mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-28 02:33:22 +01:00
multi: fix make lint
Fixes new lint errors caught by the latest version.
This commit is contained in:
parent
39b972afe0
commit
84fd911b47
@ -1795,7 +1795,7 @@ func syncNewChannel(tx kvdb.RwTx, c *OpenChannel, addrs []net.Addr) error {
|
||||
// occur. This method its to be called when we revoke our prior commitment
|
||||
// state.
|
||||
//
|
||||
// A map is returned of all the htlc resolutions that were locked in in this
|
||||
// A map is returned of all the htlc resolutions that were locked in this
|
||||
// commitment. Keys correspond to htlc indices and values indicate whether the
|
||||
// htlc was settled or failed.
|
||||
func (c *OpenChannel) UpdateCommitment(newCommitment *ChannelCommitment,
|
||||
|
@ -254,7 +254,7 @@ var (
|
||||
// See LoadConfig for further details regarding the configuration
|
||||
// loading+parsing process.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type Config struct {
|
||||
ShowVersion bool `short:"V" long:"version" description:"Display version information and exit"`
|
||||
|
||||
@ -465,7 +465,7 @@ type Config struct {
|
||||
|
||||
// DefaultConfig returns all default values for the Config struct.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
func DefaultConfig() Config {
|
||||
return Config{
|
||||
LndDir: DefaultLndDir,
|
||||
|
@ -7,5 +7,5 @@ type mockHTLCNotifier struct {
|
||||
}
|
||||
|
||||
func (m *mockHTLCNotifier) NotifyFinalHtlcEvent(key channeldb.CircuitKey,
|
||||
info channeldb.FinalHtlcInfo) { // nolint:whitespace
|
||||
info channeldb.FinalHtlcInfo) { //nolint:whitespace
|
||||
}
|
||||
|
@ -5249,7 +5249,7 @@ func TestChannelLinkFail(t *testing.T) {
|
||||
c.cfg.Peer.(*mockPeer).disconnected = true
|
||||
},
|
||||
func(*testing.T, *channelLink,
|
||||
*lnwallet.LightningChannel) { // nolint:whitespace,lll
|
||||
*lnwallet.LightningChannel) { //nolint:whitespace,lll
|
||||
|
||||
// Should fail at startup.
|
||||
},
|
||||
@ -5269,7 +5269,7 @@ func TestChannelLinkFail(t *testing.T) {
|
||||
c.channel.State().Packager = pkg
|
||||
},
|
||||
func(*testing.T, *channelLink,
|
||||
*lnwallet.LightningChannel) { // nolint:whitespace,lll
|
||||
*lnwallet.LightningChannel) { //nolint:whitespace,lll
|
||||
|
||||
// Should fail at startup.
|
||||
},
|
||||
|
@ -1101,5 +1101,5 @@ func (h *mockHTLCNotifier) NotifySettleEvent(key HtlcKey,
|
||||
}
|
||||
|
||||
func (h *mockHTLCNotifier) NotifyFinalHtlcEvent(key channeldb.CircuitKey,
|
||||
info channeldb.FinalHtlcInfo) { // nolint:whitespace
|
||||
info channeldb.FinalHtlcInfo) { //nolint:whitespace
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import "fmt"
|
||||
|
||||
// Config holds etcd configuration alongside with configuration related to our higher level interface.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type Config struct {
|
||||
Embedded bool `long:"embedded" description:"Use embedded etcd instance instead of the external one. Note: use for testing only."`
|
||||
|
||||
|
@ -4,7 +4,7 @@ import "time"
|
||||
|
||||
// Config holds postgres configuration data.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type Config struct {
|
||||
Dsn string `long:"dsn" description:"Database connection string."`
|
||||
Timeout time.Duration `long:"timeout" description:"Database connection timeout. Set to zero to disable."`
|
||||
|
@ -2,7 +2,7 @@ package lncfg
|
||||
|
||||
// AutoPilot holds the configuration options for the daemon's autopilot.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type AutoPilot struct {
|
||||
Active bool `long:"active" description:"If the autopilot agent should be active or not."`
|
||||
Heuristic map[string]float64 `long:"heuristic" description:"Heuristic to activate, and the weight to give it during scoring."`
|
||||
|
@ -5,7 +5,7 @@ import "time"
|
||||
// Bitcoind holds the configuration options for the daemon's connection to
|
||||
// bitcoind.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type Bitcoind struct {
|
||||
Dir string `long:"dir" description:"The base directory that contains the node's data, logs, configuration file, etc."`
|
||||
ConfigPath string `long:"config" description:"Configuration filepath. If not set, will default to the default filename under 'dir'."`
|
||||
|
@ -2,7 +2,7 @@ package lncfg
|
||||
|
||||
// Btcd holds the configuration options for the daemon's connection to btcd.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type Btcd struct {
|
||||
Dir string `long:"dir" description:"The base directory that contains the node's data, logs, configuration file, etc."`
|
||||
RPCHost string `long:"rpchost" description:"The daemon's rpc listening address. If a port is omitted, then the default port for the selected chain parameters will be used."`
|
||||
|
@ -21,7 +21,7 @@ const (
|
||||
|
||||
// Caches holds the configuration for various caches within lnd.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type Caches struct {
|
||||
// RejectCacheSize is the maximum number of entries stored in lnd's
|
||||
// reject cache, which is used for efficiently rejecting gossip updates.
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
|
||||
// Chain holds the configuration options for the daemon's chain settings.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type Chain struct {
|
||||
Active bool `long:"active" description:"If the chain should be active or not."`
|
||||
ChainDir string `long:"chaindir" description:"The directory to store the chain's data within."`
|
||||
|
@ -51,7 +51,7 @@ const (
|
||||
|
||||
// DB holds database configuration for LND.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type DB struct {
|
||||
Backend string `long:"backend" description:"The selected database backend."`
|
||||
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/routing/route"
|
||||
)
|
||||
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type Gossip struct {
|
||||
PinnedSyncersRaw []string `long:"pinned-syncers" description:"A set of peers that should always remain in an active sync state, which can be used to closely synchronize the routing tables of two nodes. The value should be comma separated list of hex-encoded pubkeys. Connected peers matching this pubkey will remain active for the duration of the connection and not count towards the NumActiveSyncer count."`
|
||||
|
||||
|
@ -23,7 +23,7 @@ var (
|
||||
// HealthCheckConfig contains the configuration for the different health checks
|
||||
// the lnd runs.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type HealthCheckConfig struct {
|
||||
ChainCheck *CheckConfig `group:"chainbackend" namespace:"chainbackend"`
|
||||
|
||||
|
@ -13,7 +13,7 @@ var (
|
||||
MaxMailboxDeliveryTimeout = 2 * time.Minute
|
||||
)
|
||||
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type Htlcswitch struct {
|
||||
MailboxDeliveryTimeout time.Duration `long:"mailboxdeliverytimeout" description:"The timeout value when delivering HTLCs to a channel link. Setting this value too small will result in local payment failures if large number of payments are sent over a short period."`
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ const DefaultHoldInvoiceExpiryDelta = DefaultIncomingBroadcastDelta + 2
|
||||
|
||||
// Invoices holds the configuration options for invoices.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type Invoices struct {
|
||||
HoldExpiryDelta uint32 `long:"holdexpirydelta" description:"The number of blocks before a hold invoice's htlc expires that the invoice should be canceled to prevent a force close. Force closes will not be prevented if this value is not greater than DefaultIncomingBroadcastDelta."`
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ package lncfg
|
||||
// Prometheus is the set of configuration data that specifies the listening
|
||||
// address of the Prometheus exporter.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type Prometheus struct {
|
||||
// Listen is the listening address that we should use to allow the main
|
||||
// Prometheus server to scrape our metrics.
|
||||
|
@ -5,7 +5,7 @@ import "time"
|
||||
// Neutrino holds the configuration options for the daemon's connection to
|
||||
// neutrino.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type Neutrino struct {
|
||||
AddPeers []string `short:"a" long:"addpeer" description:"Add a peer to connect with at startup"`
|
||||
ConnectPeers []string `long:"connect" description:"Connect only to the specified peers at startup"`
|
||||
|
@ -7,7 +7,7 @@ package lncfg
|
||||
// compatibility of protocol additions, while defaulting to the latest within
|
||||
// lnd, or to enable experimental protocol changes.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type ProtocolOptions struct {
|
||||
// LegacyProtocol is a sub-config that houses all the legacy protocol
|
||||
// options. These are mostly used for integration tests as most modern
|
||||
|
@ -7,7 +7,7 @@ package lncfg
|
||||
// are mostly used for integration tests as most modern nodes should always run
|
||||
// with them on by default.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type LegacyProtocol struct {
|
||||
// LegacyOnionFormat if set to true, then we won't signal
|
||||
// TLVOnionPayloadOptional. As a result, nodes that include us in the
|
||||
|
@ -7,7 +7,7 @@ package lncfg
|
||||
// compatibility of protocol additions, while defaulting to the latest within
|
||||
// lnd, or to enable experimental protocol changes.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type ProtocolOptions struct {
|
||||
// LegacyProtocol is a sub-config that houses all the legacy protocol
|
||||
// options. These are mostly used for integration tests as most modern
|
||||
|
@ -13,7 +13,7 @@ const (
|
||||
|
||||
// RemoteSigner holds the configuration options for a remote RPC signer.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type RemoteSigner struct {
|
||||
Enable bool `long:"enable" description:"Use a remote signer for signing any on-chain related transactions or messages. Only recommended if local wallet is initialized as watch-only. Remote signer must use the same seed/root key as the local watch-only wallet but must have private keys."`
|
||||
RPCHost string `long:"rpchost" description:"The remote signer's RPC host:port"`
|
||||
|
@ -2,7 +2,7 @@ package lncfg
|
||||
|
||||
// Routing holds the configuration options for routing.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type Routing struct {
|
||||
AssumeChannelValid bool `long:"assumechanvalid" description:"Skip checking channel spentness during graph validation. This speedup comes at the risk of using an unvalidated view of the network for routing. (default: false)"`
|
||||
|
||||
|
@ -16,7 +16,7 @@ const (
|
||||
|
||||
// RPCMiddleware holds the configuration for RPC interception middleware.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type RPCMiddleware struct {
|
||||
Enable bool `long:"enable" description:"Enable the RPC middleware interceptor functionality."`
|
||||
InterceptTimeout time.Duration `long:"intercepttimeout" description:"Time after which a RPC middleware intercept request will time out and return an error if it hasn't yet received a response."`
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type Sweeper struct {
|
||||
BatchWindowDuration time.Duration `long:"batchwindowduration" description:"Duration of the sweep batch window. The sweep is held back during the batch window to allow more inputs to be added and thereby lower the fee per input."`
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package lncfg
|
||||
|
||||
// Tor holds the configuration options for the daemon's connection to tor.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type Tor struct {
|
||||
Active bool `long:"active" description:"Allow outbound and inbound connections to be routed through Tor"`
|
||||
SOCKS string `long:"socks" description:"The host:port that Tor's exposed SOCKS5 proxy is listening on"`
|
||||
|
@ -5,7 +5,7 @@ import "github.com/lightningnetwork/lnd/watchtower"
|
||||
// Watchtower holds the daemon specific configuration parameters for running a
|
||||
// watchtower that shares resources with the daemon.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type Watchtower struct {
|
||||
Active bool `long:"active" description:"If the watchtower should be active or not"`
|
||||
|
||||
|
@ -19,7 +19,7 @@ const (
|
||||
// Workers exposes CLI configuration for turning resources consumed by worker
|
||||
// pools.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type Workers struct {
|
||||
// Read is the maximum number of concurrent read pool workers.
|
||||
Read int `long:"read" description:"Maximum number of concurrent read pool workers. This number should be proportional to the number of peers."`
|
||||
|
@ -4,7 +4,7 @@ import "fmt"
|
||||
|
||||
// WtClient holds the configuration options for the daemon's watchtower client.
|
||||
//
|
||||
// nolint:lll
|
||||
//nolint:lll
|
||||
type WtClient struct {
|
||||
// Active determines whether a watchtower client should be created to
|
||||
// back up channel states with registered watchtowers.
|
||||
|
@ -1164,7 +1164,6 @@ func (h *HarnessTest) AssertAllTxesSpendFrom(txes []*wire.MsgTx,
|
||||
}
|
||||
|
||||
// AssertTxSpendFrom asserts that a given tx is spent from a previous tx.
|
||||
// tx.
|
||||
func (h *HarnessTest) AssertTxSpendFrom(tx *wire.MsgTx,
|
||||
prevTxid chainhash.Hash) {
|
||||
|
||||
|
@ -16,8 +16,8 @@ type (
|
||||
AnnResp *peersrpc.NodeAnnouncementUpdateResponse
|
||||
)
|
||||
|
||||
// UpdateNodeAnnouncement makes an UpdateNodeAnnouncement RPC call the the
|
||||
// peersrpc client and asserts.
|
||||
// UpdateNodeAnnouncement makes an UpdateNodeAnnouncement RPC call the peersrpc
|
||||
// client and asserts.
|
||||
func (h *HarnessRPC) UpdateNodeAnnouncement(req AnnReq) AnnResp {
|
||||
ctxt, cancel := context.WithTimeout(h.runCtx, DefaultTimeout)
|
||||
defer cancel()
|
||||
@ -28,7 +28,7 @@ func (h *HarnessRPC) UpdateNodeAnnouncement(req AnnReq) AnnResp {
|
||||
return resp
|
||||
}
|
||||
|
||||
// UpdateNodeAnnouncementErr makes an UpdateNodeAnnouncement RPC call the the
|
||||
// UpdateNodeAnnouncementErr makes an UpdateNodeAnnouncement RPC call the
|
||||
// peersrpc client and asserts an error is returned.
|
||||
func (h *HarnessRPC) UpdateNodeAnnouncementErr(req AnnReq) {
|
||||
ctxt, cancel := context.WithTimeout(h.runCtx, DefaultTimeout)
|
||||
|
@ -1165,7 +1165,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
IsForwardedHTLC: s.htlcSwitch.IsForwardedHTLC,
|
||||
Clock: clock.NewDefaultClock(),
|
||||
SubscribeBreachComplete: s.breachArbiter.SubscribeBreachComplete,
|
||||
PutFinalHtlcOutcome: s.chanStateDB.PutOnchainFinalHtlcOutcome, // nolint: lll
|
||||
PutFinalHtlcOutcome: s.chanStateDB.PutOnchainFinalHtlcOutcome, //nolint: lll
|
||||
HtlcNotifier: s.htlcNotifier,
|
||||
}, dbs.ChanStateDB)
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
package zpay32
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
@ -39,7 +38,6 @@ func FuzzEncode(f *testing.F) {
|
||||
|
||||
// Initialize the static key we will be using for this fuzz
|
||||
// test.
|
||||
testPrivKeyBytes, _ := hex.DecodeString("e126f68f7eafcc8b74f54d269fe206be715000f94dac067d1c04a8ca3b2db734") // nolint:lll
|
||||
testPrivKey, _ := btcec.PrivKeyFromBytes(testPrivKeyBytes)
|
||||
|
||||
// Then, initialize the testMessageSigner so we can encode out
|
||||
|
Loading…
x
Reference in New Issue
Block a user