diff --git a/channeldb/channel.go b/channeldb/channel.go index 58956620ec..cd149c861a 100644 --- a/channeldb/channel.go +++ b/channeldb/channel.go @@ -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, diff --git a/config.go b/config.go index ef187e6a64..4a7123bf28 100644 --- a/config.go +++ b/config.go @@ -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, diff --git a/contractcourt/mock_htlcnotifier_test.go b/contractcourt/mock_htlcnotifier_test.go index dc1f0cc7c0..4cabfa7a93 100644 --- a/contractcourt/mock_htlcnotifier_test.go +++ b/contractcourt/mock_htlcnotifier_test.go @@ -7,5 +7,5 @@ type mockHTLCNotifier struct { } func (m *mockHTLCNotifier) NotifyFinalHtlcEvent(key channeldb.CircuitKey, - info channeldb.FinalHtlcInfo) { // nolint:whitespace + info channeldb.FinalHtlcInfo) { //nolint:whitespace } diff --git a/htlcswitch/link_test.go b/htlcswitch/link_test.go index d2387ff138..b16f3893c5 100644 --- a/htlcswitch/link_test.go +++ b/htlcswitch/link_test.go @@ -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. }, diff --git a/htlcswitch/mock.go b/htlcswitch/mock.go index c544bff15c..9eac221dd2 100644 --- a/htlcswitch/mock.go +++ b/htlcswitch/mock.go @@ -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 } diff --git a/kvdb/etcd/config.go b/kvdb/etcd/config.go index 89b8a8b2f2..76ca264c9c 100644 --- a/kvdb/etcd/config.go +++ b/kvdb/etcd/config.go @@ -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."` diff --git a/kvdb/postgres/config.go b/kvdb/postgres/config.go index f86efbecf8..0c2959d16a 100644 --- a/kvdb/postgres/config.go +++ b/kvdb/postgres/config.go @@ -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."` diff --git a/lncfg/autopilot.go b/lncfg/autopilot.go index 4e7f38e50d..60728fb26a 100644 --- a/lncfg/autopilot.go +++ b/lncfg/autopilot.go @@ -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."` diff --git a/lncfg/bitcoind.go b/lncfg/bitcoind.go index 371e2b295c..a54aefa27d 100644 --- a/lncfg/bitcoind.go +++ b/lncfg/bitcoind.go @@ -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'."` diff --git a/lncfg/btcd.go b/lncfg/btcd.go index 53ebb84ce0..dece35bf04 100644 --- a/lncfg/btcd.go +++ b/lncfg/btcd.go @@ -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."` diff --git a/lncfg/caches.go b/lncfg/caches.go index dd453b7e50..5f257d8a1f 100644 --- a/lncfg/caches.go +++ b/lncfg/caches.go @@ -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. diff --git a/lncfg/chain.go b/lncfg/chain.go index 25fc823f2d..079b30032d 100644 --- a/lncfg/chain.go +++ b/lncfg/chain.go @@ -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."` diff --git a/lncfg/db.go b/lncfg/db.go index cd0deb4df7..c951863c7e 100644 --- a/lncfg/db.go +++ b/lncfg/db.go @@ -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."` diff --git a/lncfg/gossip.go b/lncfg/gossip.go index 62d936795f..93276d9999 100644 --- a/lncfg/gossip.go +++ b/lncfg/gossip.go @@ -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."` diff --git a/lncfg/healthcheck.go b/lncfg/healthcheck.go index 446f0151af..92c4154749 100644 --- a/lncfg/healthcheck.go +++ b/lncfg/healthcheck.go @@ -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"` diff --git a/lncfg/htlcswitch.go b/lncfg/htlcswitch.go index 4fdc85749e..4b553e3547 100644 --- a/lncfg/htlcswitch.go +++ b/lncfg/htlcswitch.go @@ -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."` } diff --git a/lncfg/invoices.go b/lncfg/invoices.go index cdff2b3e86..bdd104186b 100644 --- a/lncfg/invoices.go +++ b/lncfg/invoices.go @@ -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."` } diff --git a/lncfg/monitoring_on.go b/lncfg/monitoring_on.go index b610e3457b..12c59e2b21 100644 --- a/lncfg/monitoring_on.go +++ b/lncfg/monitoring_on.go @@ -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. diff --git a/lncfg/neutrino.go b/lncfg/neutrino.go index 205e53c6fe..638c8457df 100644 --- a/lncfg/neutrino.go +++ b/lncfg/neutrino.go @@ -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"` diff --git a/lncfg/protocol.go b/lncfg/protocol.go index 5e35c368bf..238e8c485a 100644 --- a/lncfg/protocol.go +++ b/lncfg/protocol.go @@ -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 diff --git a/lncfg/protocol_legacy_on.go b/lncfg/protocol_legacy_on.go index 8b78ace111..a575fb7f38 100644 --- a/lncfg/protocol_legacy_on.go +++ b/lncfg/protocol_legacy_on.go @@ -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 diff --git a/lncfg/protocol_rpctest.go b/lncfg/protocol_rpctest.go index 09463a7ebc..7fca60f10f 100644 --- a/lncfg/protocol_rpctest.go +++ b/lncfg/protocol_rpctest.go @@ -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 diff --git a/lncfg/remotesigner.go b/lncfg/remotesigner.go index b2579c1d99..24ca61cfbd 100644 --- a/lncfg/remotesigner.go +++ b/lncfg/remotesigner.go @@ -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"` diff --git a/lncfg/routing.go b/lncfg/routing.go index 8e619e35af..47d321fd97 100644 --- a/lncfg/routing.go +++ b/lncfg/routing.go @@ -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)"` diff --git a/lncfg/rpcmiddleware.go b/lncfg/rpcmiddleware.go index 5b6a77a788..173785e01a 100644 --- a/lncfg/rpcmiddleware.go +++ b/lncfg/rpcmiddleware.go @@ -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."` diff --git a/lncfg/sweeper.go b/lncfg/sweeper.go index a0c3cd8889..feca51ccb7 100644 --- a/lncfg/sweeper.go +++ b/lncfg/sweeper.go @@ -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."` } diff --git a/lncfg/tor.go b/lncfg/tor.go index 00c7b081bc..4f043128a6 100644 --- a/lncfg/tor.go +++ b/lncfg/tor.go @@ -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"` diff --git a/lncfg/watchtower.go b/lncfg/watchtower.go index 95c5ca09a2..4ef2919a2d 100644 --- a/lncfg/watchtower.go +++ b/lncfg/watchtower.go @@ -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"` diff --git a/lncfg/workers.go b/lncfg/workers.go index e734284418..30961f063d 100644 --- a/lncfg/workers.go +++ b/lncfg/workers.go @@ -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."` diff --git a/lncfg/wtclient.go b/lncfg/wtclient.go index 06c8041ef5..8b9f039392 100644 --- a/lncfg/wtclient.go +++ b/lncfg/wtclient.go @@ -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. diff --git a/lntemp/harness_assertion.go b/lntemp/harness_assertion.go index dec709968c..ab93af89ad 100644 --- a/lntemp/harness_assertion.go +++ b/lntemp/harness_assertion.go @@ -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) { diff --git a/lntemp/rpc/peers.go b/lntemp/rpc/peers.go index 2ec69b48e7..6b43a02bc8 100644 --- a/lntemp/rpc/peers.go +++ b/lntemp/rpc/peers.go @@ -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) diff --git a/server.go b/server.go index a722a16f8e..6e44cbd6bf 100644 --- a/server.go +++ b/server.go @@ -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) diff --git a/zpay32/fuzz_test.go b/zpay32/fuzz_test.go index 4d3a19a9cd..bb948c20f4 100644 --- a/zpay32/fuzz_test.go +++ b/zpay32/fuzz_test.go @@ -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