From 530a2059e5bc9f144aba186c53852f0ad42ed232 Mon Sep 17 00:00:00 2001 From: Dimitris Apostolou Date: Thu, 13 Jan 2022 18:29:43 +0200 Subject: [PATCH] multi: Fix typos [skip ci] --- aezeed/cipherseed.go | 2 +- autopilot/agent_test.go | 4 ++-- autopilot/betweenness_centrality.go | 6 ++--- autopilot/centrality_testdata_test.go | 2 +- autopilot/choice.go | 4 ++-- autopilot/combinedattach.go | 2 +- build/log_test.go | 2 +- build/version.go | 2 +- chainntnfs/txnotifier.go | 8 +++---- chainntnfs/txnotifier_test.go | 8 +++---- chanacceptor/rpcacceptor.go | 2 +- channeldb/channel.go | 6 ++--- channeldb/db.go | 4 ++-- channeldb/db_test.go | 4 ++-- channeldb/forwarding_log.go | 4 ++-- channeldb/invoices.go | 6 ++--- .../lnwire21/gossip_timestamp_range.go | 2 +- .../migration21/current/current_encoding.go | 2 +- .../migration21/legacy/legacy_decoding.go | 2 +- channeldb/migration21/migration.go | 4 ++-- channeldb/migration_01_to_11/channel.go | 2 +- .../migration_01_to_11/migrations_test.go | 2 +- .../migration_01_to_11/zpay32/invoice.go | 2 +- channeldb/options.go | 2 +- channeldb/payment_control.go | 6 ++--- channeldb/payment_control_test.go | 4 ++-- channeldb/payments.go | 2 +- cluster/etcd_elector.go | 2 +- cluster/factory.go | 2 +- cmd/lncli/arg_parse.go | 4 ++-- config.go | 6 ++--- contractcourt/breacharbiter.go | 2 +- contractcourt/breacharbiter_test.go | 4 ++-- contractcourt/briefcase.go | 4 ++-- contractcourt/chain_arbitrator.go | 6 ++--- contractcourt/htlc_timeout_resolver_test.go | 12 +++++----- discovery/bootstrapper.go | 4 ++-- discovery/gossiper.go | 2 +- discovery/gossiper_test.go | 16 ++++++------- discovery/sync_manager.go | 6 ++--- docs/INSTALL.md | 2 +- docs/MAKEFILE.md | 2 +- docs/code_contribution_guidelines.md | 4 ++-- docs/etcd.md | 4 ++-- docs/leader_election.md | 4 ++-- docs/recovery.md | 2 +- docs/rest/websockets.md | 2 +- feature/manager.go | 2 +- funding/commitment_type_negotiation.go | 2 +- funding/manager.go | 2 +- funding/manager_test.go | 4 ++-- htlcswitch/circuit_map.go | 2 +- htlcswitch/interceptable_switch.go | 2 +- htlcswitch/link_test.go | 6 ++--- htlcswitch/mailbox.go | 6 ++--- htlcswitch/packet.go | 2 +- htlcswitch/switch.go | 2 +- htlcswitch/switch_test.go | 6 ++--- input/script_utils.go | 2 +- input/witnessgen.go | 2 +- invoices/invoice_expiry_watcher.go | 8 +++---- invoices/invoiceregistry.go | 8 +++---- invoices/invoiceregistry_test.go | 14 +++++------ invoices/update.go | 2 +- lncfg/protocol.go | 2 +- lncfg/protocol_legacy_off.go | 2 +- lncfg/protocol_legacy_on.go | 2 +- lncfg/protocol_rpctest.go | 2 +- lnd.go | 2 +- lnrpc/autopilotrpc/driver.go | 2 +- lnrpc/routerrpc/driver.go | 2 +- lnrpc/routerrpc/forward_interceptor.go | 2 +- lnrpc/routerrpc/router_backend.go | 2 +- lnrpc/routerrpc/router_server.go | 4 ++-- lnrpc/signrpc/driver.go | 2 +- lnrpc/walletrpc/driver.go | 2 +- lnrpc/watchtowerrpc/handler.go | 2 +- lnrpc/wtclientrpc/driver.go | 2 +- lntest/harness_node.go | 2 +- lntest/itest/lnd_amp_test.go | 4 ++-- lntest/itest/lnd_channel_force_close_test.go | 2 +- lntest/itest/lnd_channel_graph_test.go | 4 ++-- lntest/itest/lnd_channel_policy_test.go | 2 +- lntest/itest/lnd_forward_interceptor_test.go | 2 +- lntest/itest/lnd_funding_test.go | 2 +- lntest/itest/lnd_hold_invoice_force_test.go | 2 +- lntest/itest/lnd_hold_persistence_test.go | 4 ++-- lntest/itest/lnd_misc_test.go | 2 +- ...d_multi-hop_htlc_local_chain_claim_test.go | 2 +- ..._multi-hop_htlc_remote_chain_claim_test.go | 2 +- lntest/itest/lnd_wipe_fwdpkgs_test.go | 4 ++-- lnwallet/channel.go | 8 +++---- lnwallet/channel_test.go | 24 +++++++++---------- lnwallet/commitment.go | 8 +++---- lnwallet/wallet.go | 2 +- mobile/README.md | 2 +- mobile/bindings.go | 2 +- nat/traversal.go | 2 +- netann/chan_status_manager.go | 8 +++---- netann/chan_status_manager_test.go | 2 +- netann/channel_state.go | 2 +- peer/brontide.go | 4 ++-- peer/brontide_test.go | 2 +- pool/worker.go | 6 ++--- queue/gc_queue.go | 4 ++-- record/amp.go | 6 ++--- record/hop.go | 4 ++-- routing/chainview/bitcoind.go | 2 +- routing/control_tower.go | 6 ++--- routing/errors.go | 2 +- routing/missioncontrol.go | 2 +- routing/missioncontrol_state.go | 2 +- routing/pathfind_test.go | 2 +- routing/payment_lifecycle.go | 4 ++-- routing/payment_lifecycle_test.go | 6 ++--- routing/result_interpretation.go | 2 +- routing/router.go | 4 ++-- routing/router_test.go | 2 +- routing/shards/shard_tracker.go | 8 +++---- routing/shards/shard_tracker_test.go | 2 +- routing/validation_barrier.go | 4 ++-- rpcperms/interceptor.go | 6 ++--- rpcserver.go | 2 +- sample-lnd.conf | 4 ++-- server.go | 4 ++-- server_test.go | 6 ++--- sweep/sweeper.go | 2 +- tlv/tlv_test.go | 2 +- tor/controller.go | 2 +- tor/controller_test.go | 4 ++-- watchtower/lookout/lookout.go | 2 +- watchtower/wtclient/backup_task.go | 2 +- watchtower/wtclient/session_negotiator.go | 4 ++-- watchtower/wtdb/client_db.go | 2 +- watchtower/wtdb/client_db_test.go | 2 +- watchtower/wtdb/session_info.go | 2 +- watchtower/wtdb/tower.go | 2 +- watchtower/wtdb/tower_db_test.go | 2 +- zpay32/invoice.go | 2 +- 139 files changed, 254 insertions(+), 254 deletions(-) diff --git a/aezeed/cipherseed.go b/aezeed/cipherseed.go index a288dae39..4b97a5d72 100644 --- a/aezeed/cipherseed.go +++ b/aezeed/cipherseed.go @@ -498,7 +498,7 @@ func decipherCipherSeed(cipherSeedBytes [EncipheredCipherSeedSize]byte, } // Decipher attempts to decipher the encoded mnemonic by first mapping to the -// original chipertext, then applying our deciphering scheme. ErrInvalidPass +// original ciphertext, then applying our deciphering scheme. ErrInvalidPass // will be returned if the passphrase is incorrect. func (m *Mnemonic) Decipher(pass []byte) ([DecipheredCipherSeedSize]byte, error) { diff --git a/autopilot/agent_test.go b/autopilot/agent_test.go index b12ab792f..92ed36dc8 100644 --- a/autopilot/agent_test.go +++ b/autopilot/agent_test.go @@ -339,7 +339,7 @@ func TestAgentHeuristicUpdateSignal(t *testing.T) { // initial check. respondMoreChans(t, testCtx, moreChansResp{0, 0}) - // Next we'll signal that one of the heuristcs have been updated. + // Next we'll signal that one of the heuristics have been updated. testCtx.agent.OnHeuristicUpdate(testCtx.heuristic) // The update should trigger the agent to ask for a channel budget.so @@ -1256,7 +1256,7 @@ func TestAgentChannelSizeAllocation(t *testing.T) { "had %v", len(arg.chans)) } if arg.balance != testCtx.walletBalance { - t.Fatalf("expectd agent to have %v balance, had %v", + t.Fatalf("expected agent to have %v balance, had %v", testCtx.walletBalance, arg.balance) } case <-time.After(time.Second * 3): diff --git a/autopilot/betweenness_centrality.go b/autopilot/betweenness_centrality.go index aa0b9fced..db45bcf66 100644 --- a/autopilot/betweenness_centrality.go +++ b/autopilot/betweenness_centrality.go @@ -51,7 +51,7 @@ func (q *queue) empty() bool { // BetweennessCentrality is a NodeMetric that calculates node betweenness // centrality using Brandes' algorithm. Betweenness centrality for each node -// is the number of shortest paths passing trough that node, not counting +// is the number of shortest paths passing through that node, not counting // shortest paths starting or ending at that node. This is a useful metric // to measure control of individual nodes over the whole network. type BetweennessCentrality struct { @@ -167,7 +167,7 @@ func betweennessCentrality(g *SimpleGraph, s int, centrality []float64) { } } -// Refresh recaculates and stores centrality values. +// Refresh recalculates and stores centrality values. func (bc *BetweennessCentrality) Refresh(graph ChannelGraph) error { cache, err := NewSimpleGraph(graph) if err != nil { @@ -186,7 +186,7 @@ func (bc *BetweennessCentrality) Refresh(graph ChannelGraph) error { partial := make([]float64, len(cache.Nodes)) // Consume the next node, update centrality - // parital to avoid unnecessary synchronizaton. + // parital to avoid unnecessary synchronization. for node := range work { betweennessCentrality(cache, node, partial) } diff --git a/autopilot/centrality_testdata_test.go b/autopilot/centrality_testdata_test.go index 4675fa4d4..075c1bf1e 100644 --- a/autopilot/centrality_testdata_test.go +++ b/autopilot/centrality_testdata_test.go @@ -35,7 +35,7 @@ var normalizedTestGraphCentrality = []float64{ 0.2, 0.0, 0.2, 1.0, 0.4, 0.4, 7.0 / 15.0, 0.0, 0.0, } -// buildTestGraph builds a test graph from a passed graph desriptor. +// buildTestGraph builds a test graph from a passed graph descriptor. func buildTestGraph(t *testing.T, graph testGraph, desc testGraphDesc) map[int]*btcec.PublicKey { diff --git a/autopilot/choice.go b/autopilot/choice.go index 661f58d93..26bcd3ce6 100644 --- a/autopilot/choice.go +++ b/autopilot/choice.go @@ -11,7 +11,7 @@ import ( var ErrNoPositive = errors.New("no positive weights left") // weightedChoice draws a random index from the slice of weights, with a -// probability propotional to the weight at the given index. +// probability proportional to the weight at the given index. func weightedChoice(w []float64) (int, error) { // Calculate the sum of weights. var sum float64 @@ -25,7 +25,7 @@ func weightedChoice(w []float64) (int, error) { // Pick a random number in the range [0.0, 1.0) and multiply it with // the sum of weights. Then we'll iterate the weights until the number - // goes below 0. This means that each index is picked with a probablity + // goes below 0. This means that each index is picked with a probability // equal to their normalized score. // // Example: diff --git a/autopilot/combinedattach.go b/autopilot/combinedattach.go index 56041d084..617774667 100644 --- a/autopilot/combinedattach.go +++ b/autopilot/combinedattach.go @@ -92,7 +92,7 @@ func (c *WeightedCombAttachment) NodeScores(g ChannelGraph, chans []LocalChannel } // We combine the scores given by the sub-heuristics by using the - // heruistics' given weight factor. + // heuristics' given weight factor. scores := make(map[NodeID]*NodeScore) for nID := range nodes { score := &NodeScore{ diff --git a/build/log_test.go b/build/log_test.go index b26c125b5..001b8e08b 100644 --- a/build/log_test.go +++ b/build/log_test.go @@ -32,7 +32,7 @@ func (m *mockSubLogger) SetLogLevels(logLevel string) { m.globalLogLevel = logLevel } -// TestParseAndSetDebugLevels tests tha we can properly set the log levels for +// TestParseAndSetDebugLevels tests that we can properly set the log levels for // all andspecified subsystems. func TestParseAndSetDebugLevels(t *testing.T) { testCases := []struct { diff --git a/build/version.go b/build/version.go index bd7fd88e0..7b9e9756c 100644 --- a/build/version.go +++ b/build/version.go @@ -26,7 +26,7 @@ var ( RawTags string // GoVersion stores the go version that the executable was compiled - // with. This hsould be set using -ldflags during compilation. + // with. This should be set using -ldflags during compilation. GoVersion string ) diff --git a/chainntnfs/txnotifier.go b/chainntnfs/txnotifier.go index b7fc638af..cd7ea55b1 100644 --- a/chainntnfs/txnotifier.go +++ b/chainntnfs/txnotifier.go @@ -254,7 +254,7 @@ type ConfNtfn struct { dispatched bool } -// HistoricalConfDispatch parameterizes a manual rescan for a particular +// HistoricalConfDispatch parametrizes a manual rescan for a particular // transaction/output script. The parameters include the start and end block // heights specifying the range of blocks to scan. type HistoricalConfDispatch struct { @@ -408,12 +408,12 @@ type SpendNtfn struct { // an entry for it. HeightHint uint32 - // dispatched signals whether a spend notification has been disptached + // dispatched signals whether a spend notification has been dispatched // to the client. dispatched bool } -// HistoricalSpendDispatch parameterizes a manual rescan to determine the +// HistoricalSpendDispatch parametrizes a manual rescan to determine the // spending details (if any) of an outpoint/output script. The parameters // include the start and end block heights specifying the range of blocks to // scan. @@ -523,7 +523,7 @@ type TxNotifier struct { // NewTxNotifier creates a TxNotifier. The current height of the blockchain is // accepted as a parameter. The different hint caches (confirm and spend) are // used as an optimization in order to retrieve a better starting point when -// dispatching a recan for a historical event in the chain. +// dispatching a rescan for a historical event in the chain. func NewTxNotifier(startHeight uint32, reorgSafetyLimit uint32, confirmHintCache ConfirmHintCache, spendHintCache SpendHintCache) *TxNotifier { diff --git a/chainntnfs/txnotifier_test.go b/chainntnfs/txnotifier_test.go index 28c6e73a3..0eac47ca8 100644 --- a/chainntnfs/txnotifier_test.go +++ b/chainntnfs/txnotifier_test.go @@ -282,7 +282,7 @@ func TestTxNotifierFutureConfDispatch(t *testing.T) { t.Fatal("Expected confirmation update for tx1") } - // A confirmation notification for this tranaction should be dispatched, + // A confirmation notification for this transaction should be dispatched, // as it only required one confirmation. select { case txConf := <-ntfn1.Event.Confirmed: @@ -2148,7 +2148,7 @@ func TestTxNotifierSpendHintCache(t *testing.T) { op2Height = 203 ) - // Intiialize our TxNotifier instance backed by a height hint cache. + // Initialize our TxNotifier instance backed by a height hint cache. hintCache := newMockHintCache() n := chainntnfs.NewTxNotifier( startingHeight, chainntnfs.ReorgSafetyLimit, hintCache, @@ -2331,7 +2331,7 @@ func TestTxNotifierSpendDuringHistoricalRescan(t *testing.T) { reorgSafety = 10 ) - // Intiialize our TxNotifier instance backed by a height hint cache. + // Initialize our TxNotifier instance backed by a height hint cache. hintCache := newMockHintCache() n := chainntnfs.NewTxNotifier( startingHeight, reorgSafety, hintCache, hintCache, @@ -2511,7 +2511,7 @@ func TestTxNotifierSpendDuringHistoricalRescan(t *testing.T) { // matured. err = n.UpdateSpendDetails(ntfn1.HistoricalDispatch.SpendRequest, nil) if err == nil { - t.Fatalf("expcted updating spend details to fail") + t.Fatalf("expected updating spend details to fail") } // Finally, check that the height hint is still there, unchanged. diff --git a/chanacceptor/rpcacceptor.go b/chanacceptor/rpcacceptor.go index bec914355..566bd6be5 100644 --- a/chanacceptor/rpcacceptor.go +++ b/chanacceptor/rpcacceptor.go @@ -243,7 +243,7 @@ func (r *RPCAcceptor) sendAcceptRequests(errChan chan error, defer close(r.done) // Create a map of pending channel IDs to our original open channel - // request and a response channel. We keep the original chanel open + // request and a response channel. We keep the original channel open // message so that we can validate our response against it. acceptRequests := make(map[[32]byte]*chanAcceptInfo) diff --git a/channeldb/channel.go b/channeldb/channel.go index 9084d973d..746208bc5 100644 --- a/channeldb/channel.go +++ b/channeldb/channel.go @@ -287,7 +287,7 @@ func (c ChannelType) HasFundingTx() bool { return c&NoFundingTxBit == 0 } -// HasAnchors returns true if this channel type has anchor ouputs on its +// HasAnchors returns true if this channel type has anchor outputs on its // commitment. func (c ChannelType) HasAnchors() bool { return c&AnchorOutputsBit == AnchorOutputsBit @@ -3192,7 +3192,7 @@ func serializeChannelCloseSummary(w io.Writer, cs *ChannelCloseSummary) error { // The RemoteNextRevocation field is optional, as it's possible for a // channel to be closed before we learn of the next unrevoked - // revocation point for the remote party. Write a boolen indicating + // revocation point for the remote party. Write a boolean indicating // whether this field is present or not. if err := WriteElements(w, cs.RemoteNextRevocation != nil); err != nil { return err @@ -3311,7 +3311,7 @@ func writeChanConfig(b io.Writer, c *ChannelConfig) error { } // fundingTxPresent returns true if expect the funding transcation to be found -// on disk or already populated within the passed oen chanel struct. +// on disk or already populated within the passed open channel struct. func fundingTxPresent(channel *OpenChannel) bool { chanType := channel.ChanType diff --git a/channeldb/db.go b/channeldb/db.go index 1079cfd4c..6221f9c50 100644 --- a/channeldb/db.go +++ b/channeldb/db.go @@ -1037,7 +1037,7 @@ func (c *ChannelStateDB) pruneLinkNode(openChannels []*OpenChannel, return c.linkNodeDB.DeleteLinkNode(remotePub) } -// PruneLinkNodes attempts to prune all link nodes found within the databse with +// PruneLinkNodes attempts to prune all link nodes found within the database with // whom we no longer have any open channels with. func (c *ChannelStateDB) PruneLinkNodes() error { allLinkNodes, err := c.linkNodeDB.FetchAllLinkNodes() @@ -1189,7 +1189,7 @@ func (c *ChannelStateDB) AbandonChannel(chanPoint *wire.OutPoint, } // If the channel was already closed, then we don't return an - // error as we'd like fro this step to be repeatable. + // error as we'd like this step to be repeatable. return nil case err != nil: return err diff --git a/channeldb/db_test.go b/channeldb/db_test.go index 2773437f1..98c0ea228 100644 --- a/channeldb/db_test.go +++ b/channeldb/db_test.go @@ -448,7 +448,7 @@ func TestRestoreChannelShells(t *testing.T) { // The node should have the same address, as specified in the channel // shell. if reflect.DeepEqual(linkNode.Addresses, channelShell.NodeAddrs) { - t.Fatalf("addr mismach: expected %v, got %v", + t.Fatalf("addr mismatch: expected %v, got %v", linkNode.Addresses, channelShell.NodeAddrs) } } @@ -738,7 +738,7 @@ func TestFetchHistoricalChannel(t *testing.T) { histChannel, err := cdb.FetchHistoricalChannel(&channel.FundingOutpoint) if err != nil { - t.Fatalf("unexepected error getting channel: %v", err) + t.Fatalf("unexpected error getting channel: %v", err) } // FetchHistoricalChannel will attach the cdb to channel.Db, we set it diff --git a/channeldb/forwarding_log.go b/channeldb/forwarding_log.go index 3261665fd..f527b78dd 100644 --- a/channeldb/forwarding_log.go +++ b/channeldb/forwarding_log.go @@ -47,7 +47,7 @@ func (d *DB) ForwardingLog() *ForwardingLog { } } -// ForwardingLog is a time series database that logs the fulfilment of payment +// ForwardingLog is a time series database that logs the fulfillment of payment // circuits by a lightning network daemon. The log contains a series of // forwarding events which map a timestamp to a forwarding event. A forwarding // event describes which channels were used to create+settle a circuit, and the @@ -204,7 +204,7 @@ type ForwardingEventQuery struct { // ForwardingLogTimeSlice is the response to a forwarding query. It includes // the original query, the set events that match the query, and an integer -// which represents the offset index of the last item in the set of retuned +// which represents the offset index of the last item in the set of returned // events. This integer allows callers to resume their query using this offset // in the event that the query's response exceeds the max number of returnable // events. diff --git a/channeldb/invoices.go b/channeldb/invoices.go index 709c0d77a..0d01f5d76 100644 --- a/channeldb/invoices.go +++ b/channeldb/invoices.go @@ -895,7 +895,7 @@ func validateInvoice(i *Invoice, paymentHash lntypes.Hash) error { return nil } -// IsPending returns ture if the invoice is in ContractOpen state. +// IsPending returns true if the invoice is in ContractOpen state. func (i *Invoice) IsPending() bool { return i.State == ContractOpen || i.State == ContractAccepted } @@ -1189,7 +1189,7 @@ func fetchInvoiceNumByRef(invoiceIndex, payAddrIndex, setIDIndex kvdb.RBucket, } } -// ScanInvoices scans trough all invoices and calls the passed scanFunc for +// ScanInvoices scans through all invoices and calls the passed scanFunc for // for each invoice with its respective payment hash. Additionally a reset() // closure is passed which is used to reset/initialize partial results and also // to signal if the kvdb.View transaction has been retried. @@ -3020,7 +3020,7 @@ func updateInvoiceState(invoice *Invoice, hash *lntypes.Hash, } } -// cancelSingleHtlc validates cancelation of a single htlc and update its state. +// cancelSingleHtlc validates cancellation of a single htlc and update its state. func cancelSingleHtlc(resolveTime time.Time, htlc *InvoiceHTLC, invState ContractState) error { diff --git a/channeldb/migration/lnwire21/gossip_timestamp_range.go b/channeldb/migration/lnwire21/gossip_timestamp_range.go index 3c28cd056..039257c26 100644 --- a/channeldb/migration/lnwire21/gossip_timestamp_range.go +++ b/channeldb/migration/lnwire21/gossip_timestamp_range.go @@ -75,6 +75,6 @@ func (g *GossipTimestampRange) MsgType() MessageType { func (g *GossipTimestampRange) MaxPayloadLength(uint32) uint32 { // 32 + 4 + 4 // - // TODO(roasbeef): update to 8 byte timestmaps? + // TODO(roasbeef): update to 8 byte timestamps? return 40 } diff --git a/channeldb/migration21/current/current_encoding.go b/channeldb/migration21/current/current_encoding.go index 0c62c3118..02c5b20ce 100644 --- a/channeldb/migration21/current/current_encoding.go +++ b/channeldb/migration21/current/current_encoding.go @@ -280,7 +280,7 @@ func SerializeChannelCloseSummary(w io.Writer, cs *common.ChannelCloseSummary) e // The RemoteNextRevocation field is optional, as it's possible for a // channel to be closed before we learn of the next unrevoked - // revocation point for the remote party. Write a boolen indicating + // revocation point for the remote party. Write a boolean indicating // whether this field is present or not. if err := WriteElements(w, cs.RemoteNextRevocation != nil); err != nil { return err diff --git a/channeldb/migration21/legacy/legacy_decoding.go b/channeldb/migration21/legacy/legacy_decoding.go index 8a8482494..20c83bcdd 100644 --- a/channeldb/migration21/legacy/legacy_decoding.go +++ b/channeldb/migration21/legacy/legacy_decoding.go @@ -379,7 +379,7 @@ func SerializeChannelCloseSummary(w io.Writer, cs *common.ChannelCloseSummary) e // The RemoteNextRevocation field is optional, as it's possible for a // channel to be closed before we learn of the next unrevoked - // revocation point for the remote party. Write a boolen indicating + // revocation point for the remote party. Write a boolean indicating // whether this field is present or not. if err := WriteElements(w, cs.RemoteNextRevocation != nil); err != nil { return err diff --git a/channeldb/migration21/migration.go b/channeldb/migration21/migration.go index 2ee286868..51882c756 100644 --- a/channeldb/migration21/migration.go +++ b/channeldb/migration21/migration.go @@ -221,7 +221,7 @@ func migrateOpenChanBucket(tx kvdb.RwTx) error { } } - // Remote unsiged updates as well. + // Remote unsigned updates as well. updateBytes = chanBucket.Get(remoteUnsignedLocalUpdatesKey) if updateBytes != nil { legacyUnsignedUpdates, err := legacy.DeserializeLogUpdates( @@ -316,7 +316,7 @@ func migrateForwardingPackages(tx kvdb.RwTx) error { return err } - // Now load all forwading packages using the legacy encoding. + // Now load all forwarding packages using the legacy encoding. var pkgsToMigrate []*common.FwdPkg for _, source := range sources { packager := legacy.NewChannelPackager(source) diff --git a/channeldb/migration_01_to_11/channel.go b/channeldb/migration_01_to_11/channel.go index 2abdfd287..14580a09a 100644 --- a/channeldb/migration_01_to_11/channel.go +++ b/channeldb/migration_01_to_11/channel.go @@ -622,7 +622,7 @@ func serializeChannelCloseSummary(w io.Writer, cs *ChannelCloseSummary) error { // The RemoteNextRevocation field is optional, as it's possible for a // channel to be closed before we learn of the next unrevoked - // revocation point for the remote party. Write a boolen indicating + // revocation point for the remote party. Write a boolean indicating // whether this field is present or not. if err := WriteElements(w, cs.RemoteNextRevocation != nil); err != nil { return err diff --git a/channeldb/migration_01_to_11/migrations_test.go b/channeldb/migration_01_to_11/migrations_test.go index 77887e855..90069d716 100644 --- a/channeldb/migration_01_to_11/migrations_test.go +++ b/channeldb/migration_01_to_11/migrations_test.go @@ -626,7 +626,7 @@ func TestOutgoingPaymentsMigration(t *testing.T) { // Order of payments should be be preserved. old := oldPayments[i] - // Check the individial fields. + // Check the individual fields. if p.Info.Value != old.Terms.Value { t.Fatalf("value mismatch") } diff --git a/channeldb/migration_01_to_11/zpay32/invoice.go b/channeldb/migration_01_to_11/zpay32/invoice.go index 83718c9ba..a0db06408 100644 --- a/channeldb/migration_01_to_11/zpay32/invoice.go +++ b/channeldb/migration_01_to_11/zpay32/invoice.go @@ -266,7 +266,7 @@ func Features(features *lnwire.FeatureVector) func(*Invoice) { } // PaymentAddr is a functional option that allows callers of NewInvoice to set -// the desired payment address tht is advertised on the invoice. +// the desired payment address that is advertised on the invoice. func PaymentAddr(addr [32]byte) func(*Invoice) { return func(i *Invoice) { i.PaymentAddr = &addr diff --git a/channeldb/options.go b/channeldb/options.go index 8b8621bcf..068a7fa01 100644 --- a/channeldb/options.go +++ b/channeldb/options.go @@ -157,7 +157,7 @@ func OptionClock(clock clock.Clock) OptionModifier { } } -// OptionDryRunMigration controls whether or not to intentially fail to commit a +// OptionDryRunMigration controls whether or not to intentionally fail to commit a // successful migration that occurs when opening the database. func OptionDryRunMigration(dryRun bool) OptionModifier { return func(o *Options) { diff --git a/channeldb/payment_control.go b/channeldb/payment_control.go index ada24e0c2..8e8384134 100644 --- a/channeldb/payment_control.go +++ b/channeldb/payment_control.go @@ -64,11 +64,11 @@ var ( "amount") // ErrNonMPPayment is returned if we try to register an MPP attempt for - // a payment that already has a non-MPP attempt regitered. + // a payment that already has a non-MPP attempt registered. ErrNonMPPayment = errors.New("payment has non-MPP attempts") // ErrMPPayment is returned if we try to register a non-MPP attempt for - // a payment that already has an MPP attempt regitered. + // a payment that already has an MPP attempt registered. ErrMPPayment = errors.New("payment has MPP attempts") // ErrMPPPaymentAddrMismatch is returned if we try to register an MPP @@ -106,7 +106,7 @@ func NewPaymentControl(db *DB) *PaymentControl { // InitPayment checks or records the given PaymentCreationInfo with the DB, // making sure it does not already exist as an in-flight payment. When this -// method returns successfully, the payment is guranteeed to be in the InFlight +// method returns successfully, the payment is guaranteed to be in the InFlight // state. func (p *PaymentControl) InitPayment(paymentHash lntypes.Hash, info *PaymentCreationInfo) error { diff --git a/channeldb/payment_control_test.go b/channeldb/payment_control_test.go index bbd59bf0e..64484e50f 100644 --- a/channeldb/payment_control_test.go +++ b/channeldb/payment_control_test.go @@ -551,7 +551,7 @@ func TestPaymentControlDeleteNonInFligt(t *testing.T) { require.Equal(t, 1, indexCount) } -// TestPaymentControlDeletePayments tests that DeletePayments correcly deletes +// TestPaymentControlDeletePayments tests that DeletePayments correctly deletes // information about completed payments from the database. func TestPaymentControlDeletePayments(t *testing.T) { t.Parallel() @@ -605,7 +605,7 @@ func TestPaymentControlDeletePayments(t *testing.T) { assertPayments(t, db, payments[2:]) } -// TestPaymentControlDeleteSinglePayment tests that DeletePayment correcly +// TestPaymentControlDeleteSinglePayment tests that DeletePayment correctly // deletes information about a completed payment from the database. func TestPaymentControlDeleteSinglePayment(t *testing.T) { t.Parallel() diff --git a/channeldb/payments.go b/channeldb/payments.go index fefdf5bfd..cf21c0f74 100644 --- a/channeldb/payments.go +++ b/channeldb/payments.go @@ -382,7 +382,7 @@ func fetchPayment(bucket kvdb.RBucket) (*MPPayment, error) { }, nil } -// fetchHtlcAttempts retrives all htlc attempts made for the payment found in +// fetchHtlcAttempts retrieves all htlc attempts made for the payment found in // the given bucket. func fetchHtlcAttempts(bucket kvdb.RBucket) ([]HTLCAttempt, error) { htlcsMap := make(map[uint64]*HTLCAttempt) diff --git a/cluster/etcd_elector.go b/cluster/etcd_elector.go index a33ff24cf..0f5cfae8b 100644 --- a/cluster/etcd_elector.go +++ b/cluster/etcd_elector.go @@ -23,7 +23,7 @@ const ( // Enforce that etcdLeaderElector implements the LeaderElector interface. var _ LeaderElector = (*etcdLeaderElector)(nil) -// etcdLeaderElector is an implemetation of LeaderElector using etcd as the +// etcdLeaderElector is an implementation of LeaderElector using etcd as the // election governor. type etcdLeaderElector struct { id string diff --git a/cluster/factory.go b/cluster/factory.go index 52ae360bf..52b39091b 100644 --- a/cluster/factory.go +++ b/cluster/factory.go @@ -23,7 +23,7 @@ func RegisterLeaderElectorFactory(id string, factory leaderElectorFactoryFunc) { leaderElectorFactories[id] = factory } -// MakeLeaderElector will constuct a LeaderElector identified by id with the +// MakeLeaderElector will construct a LeaderElector identified by id with the // passed arguments. func MakeLeaderElector(ctx context.Context, id string, args ...interface{}) ( LeaderElector, error) { diff --git a/cmd/lncli/arg_parse.go b/cmd/lncli/arg_parse.go index 3f621a9ab..a97e0e2ed 100644 --- a/cmd/lncli/arg_parse.go +++ b/cmd/lncli/arg_parse.go @@ -21,8 +21,8 @@ var secondsPer = map[string]int64{ "y": 31557600, // 365.25 days } -// parseTime parses UNIX timestamps or short timeranges inspired by sytemd (when starting with "-"), -// e.g. "-1M" for one month (30.44 days) ago. +// parseTime parses UNIX timestamps or short timeranges inspired by systemd +// (when starting with "-"), e.g. "-1M" for one month (30.44 days) ago. func parseTime(s string, base time.Time) (uint64, error) { if reTimeRange.MatchString(s) { last := len(s) - 1 diff --git a/config.go b/config.go index e345b4e3f..c3f26cd69 100644 --- a/config.go +++ b/config.go @@ -256,7 +256,7 @@ type Config struct { LetsEncryptDir string `long:"letsencryptdir" description:"The directory to store Let's Encrypt certificates within"` LetsEncryptListen string `long:"letsencryptlisten" description:"The IP:port on which lnd will listen for Let's Encrypt challenges. Let's Encrypt will always try to contact on port 80. Often non-root processes are not allowed to bind to ports lower than 1024. This configuration option allows a different port to be used, but must be used in combination with port forwarding from port 80. This configuration can also be used to specify another IP address to listen on, for example an IPv6 address."` - LetsEncryptDomain string `long:"letsencryptdomain" description:"Request a Let's Encrypt certificate for this domain. Note that the certicate is only requested and stored when the first rpc connection comes in."` + LetsEncryptDomain string `long:"letsencryptdomain" description:"Request a Let's Encrypt certificate for this domain. Note that the certificate is only requested and stored when the first rpc connection comes in."` // We'll parse these 'raw' string arguments into real net.Addrs in the // loadConfig function. We need to expose the 'raw' strings so the @@ -326,7 +326,7 @@ type Config struct { PaymentsExpirationGracePeriod time.Duration `long:"payments-expiration-grace-period" description:"A period to wait before force closing channels with outgoing htlcs that have timed-out and are a result of this node initiated payments."` TrickleDelay int `long:"trickledelay" description:"Time in milliseconds between each release of announcements to the network"` - ChanEnableTimeout time.Duration `long:"chan-enable-timeout" description:"The duration that a peer connection must be stable before attempting to send a channel update to reenable or cancel a pending disables of the peer's channels on the network."` + ChanEnableTimeout time.Duration `long:"chan-enable-timeout" description:"The duration that a peer connection must be stable before attempting to send a channel update to re-enable or cancel a pending disables of the peer's channels on the network."` ChanDisableTimeout time.Duration `long:"chan-disable-timeout" description:"The duration that must elapse after first detecting that an already active channel is actually inactive and sending channel update disabling it to the network. The pending disable can be canceled if the peer reconnects and becomes stable for chan-enable-timeout before the disable update is sent."` ChanStatusSampleInterval time.Duration `long:"chan-status-sample-interval" description:"The polling interval between attempts to detect if an active channel has become inactive due to its peer going offline."` HeightHintCacheQueryDisable bool `long:"height-hint-cache-query-disable" description:"Disable queries from the height-hint cache to try to recover channels stuck in the pending close state. Disabling height hint queries may cause longer chain rescans, resulting in a performance hit. Unset this after channels are unstuck so you can get better performance again."` @@ -900,7 +900,7 @@ func ValidateConfig(cfg Config, interceptor signal.Interceptor, fileParser, ) } - // Don't allow superflous --maxchansize greater than + // Don't allow superfluous --maxchansize greater than // BOLT 02 soft-limit for non-wumbo channel if !cfg.ProtocolOptions.Wumbo() && cfg.MaxChanSize > int64(MaxFundingAmount) { diff --git a/contractcourt/breacharbiter.go b/contractcourt/breacharbiter.go index 3253e0009..6d20580a7 100644 --- a/contractcourt/breacharbiter.go +++ b/contractcourt/breacharbiter.go @@ -651,7 +651,7 @@ func (b *BreachArbiter) exactRetribution(confChan *chainntnfs.ConfirmationEvent, // We may have to wait for some of the HTLC outputs to be spent to the // second level before broadcasting the justice tx. We'll store the - // SpendEvents between each attempt to not re-register uneccessarily. + // SpendEvents between each attempt to not re-register unnecessarily. spendNtfns := make(map[wire.OutPoint]*chainntnfs.SpendEvent) // Compute both the total value of funds being swept and the diff --git a/contractcourt/breacharbiter_test.go b/contractcourt/breacharbiter_test.go index b402285be..f0daae630 100644 --- a/contractcourt/breacharbiter_test.go +++ b/contractcourt/breacharbiter_test.go @@ -1263,7 +1263,7 @@ func TestBreachCreateJusticeTx(t *testing.T) { // The spendCommitOuts tx should be spending the 4 typed of commit outs // (note that in practice there will be at most two commit outputs per - // commmit, but we test all 4 types here). + // commit, but we test all 4 types here). require.Len(t, justiceTxs.spendCommitOuts.TxIn, 4) // Finally check that the spendHTLCs tx are spending the two revoked @@ -1279,7 +1279,7 @@ type breachTest struct { // spend2ndLevel requests that second level htlcs be spent *again*, as // if by a remote party or watchtower. The outpoint of the second level - // htlc is in effect "readded" to the set of inputs. + // htlc is in effect "re-added" to the set of inputs. spend2ndLevel bool // sweepHtlc tests that the HTLC output is swept using the revocation diff --git a/contractcourt/briefcase.go b/contractcourt/briefcase.go index e0fd6f980..7c80b922a 100644 --- a/contractcourt/briefcase.go +++ b/contractcourt/briefcase.go @@ -364,7 +364,7 @@ var ( // chain resolutions. errNoResolutions = fmt.Errorf("no contract resolutions exist") - // errNoActions is retuned when the log doesn't contain any stored + // errNoActions is returned when the log doesn't contain any stored // chain actions. errNoActions = fmt.Errorf("no chain actions exist") @@ -1098,7 +1098,7 @@ func (b *boltArbitratorLog) checkpointContract(c ContractResolver, }, func() {}) } -// encodeSignDetails encodes the gived SignDetails struct to the writer. +// encodeSignDetails encodes the given SignDetails struct to the writer. // SignDetails is allowed to be nil, in which we will encode that it is not // present. func encodeSignDetails(w io.Writer, s *input.SignDetails) error { diff --git a/contractcourt/chain_arbitrator.go b/contractcourt/chain_arbitrator.go index 182c3205d..a39d939f6 100644 --- a/contractcourt/chain_arbitrator.go +++ b/contractcourt/chain_arbitrator.go @@ -102,7 +102,7 @@ type ChainArbitratorConfig struct { // ContractBreach is a function closure that the ChainArbitrator will // use to notify the breachArbiter about a contract breach. A callback // should be passed that when called will mark the channel pending - // close in the databae. It should only return a non-nil error when the + // close in the database. It should only return a non-nil error when the // breachArbiter has preserved the necessary breach info for this // channel point, and the callback has succeeded, meaning it is safe to // stop watching the channel. @@ -846,8 +846,8 @@ func (c *ChainArbitrator) publishClosingTxs( // rebroadcast is a helper method which will republish the unilateral or // cooperative close transaction or a channel in a particular state. // -// NOTE: There is no risk to caling this method if the channel isn't in either -// CommimentBroadcasted or CoopBroadcasted, but the logs will be misleading. +// NOTE: There is no risk to calling this method if the channel isn't in either +// CommitmentBroadcasted or CoopBroadcasted, but the logs will be misleading. func (c *ChainArbitrator) rebroadcast(channel *channeldb.OpenChannel, state channeldb.ChannelStatus) error { diff --git a/contractcourt/htlc_timeout_resolver_test.go b/contractcourt/htlc_timeout_resolver_test.go index 680b82b66..bbe0ec093 100644 --- a/contractcourt/htlc_timeout_resolver_test.go +++ b/contractcourt/htlc_timeout_resolver_test.go @@ -750,7 +750,7 @@ func TestHtlcTimeoutSingleStageRemoteSpend(t *testing.T) { witnessBeacon := ctx.resolver.(*htlcTimeoutResolver).PreimageDB.(*mockWitnessBeacon) - // The remote spends the output direcly with + // The remote spends the output directly with // the preimage. ctx.notifier.SpendChan <- &chainntnfs.SpendDetail{ SpendingTx: spendTx, @@ -978,7 +978,7 @@ func TestHtlcTimeoutSecondStageSweeper(t *testing.T) { } // twoStageResolution is a resolution for a htlc on the local - // party's commitment, where the timout tx can be re-signed. + // party's commitment, where the timeout tx can be re-signed. twoStageResolution := lnwallet.OutgoingHtlcResolution{ ClaimOutpoint: htlcOutpoint, SignedTimeoutTx: timeoutTx, @@ -1041,7 +1041,7 @@ func TestHtlcTimeoutSecondStageSweeper(t *testing.T) { preCheckpoint: func(ctx *htlcResolverTestContext, resumed bool) error { - // If we are resuming from a checkpoing, we + // If we are resuming from a checkpoint, we // expect the resolver to re-subscribe to a // spend, hence we must resend it. if resumed { @@ -1070,7 +1070,7 @@ func TestHtlcTimeoutSecondStageSweeper(t *testing.T) { Height: 13, } - // The timout tx output should now be given to + // The timeout tx output should now be given to // the sweeper. resolver := ctx.resolver.(*htlcTimeoutResolver) inp := <-resolver.Sweeper.(*mockSweeper).sweptInputs @@ -1161,7 +1161,7 @@ func TestHtlcTimeoutSecondStageSweeperRemoteSpend(t *testing.T) { spendTxHash := spendTx.TxHash() // twoStageResolution is a resolution for a htlc on the local - // party's commitment, where the timout tx can be re-signed. + // party's commitment, where the timeout tx can be re-signed. twoStageResolution := lnwallet.OutgoingHtlcResolution{ ClaimOutpoint: htlcOutpoint, SignedTimeoutTx: timeoutTx, @@ -1214,7 +1214,7 @@ func TestHtlcTimeoutSecondStageSweeperRemoteSpend(t *testing.T) { preCheckpoint: func(ctx *htlcResolverTestContext, resumed bool) error { - // If we are resuming from a checkpoing, we + // If we are resuming from a checkpoint, we // expect the resolver to re-subscribe to a // spend, hence we must resend it. if resumed { diff --git a/discovery/bootstrapper.go b/discovery/bootstrapper.go index 5bcfbdb6f..3ad9743b9 100644 --- a/discovery/bootstrapper.go +++ b/discovery/bootstrapper.go @@ -313,7 +313,7 @@ func NewDNSSeedBootstrapper( // fallBackSRVLookup attempts to manually query for SRV records we need to // properly bootstrap. We do this by querying the special record at the "soa." -// sub-domain of supporting DNS servers. The retuned IP address will be the IP +// sub-domain of supporting DNS servers. The returned IP address will be the IP // address of the authoritative DNS server. Once we have this IP address, we'll // connect manually over TCP to request the SRV record. This is necessary as // the records we return are currently too large for a class of resolvers, @@ -361,7 +361,7 @@ func (d *DNSSeedBootstrapper) fallBackSRVLookup(soaShim string, "received: %v", resp.Rcode) } - // Retrieve the RR(s) of the Answer section, and covert to the format + // Retrieve the RR(s) of the Answer section, and convert to the format // that net.LookupSRV would normally return. var rrs []*net.SRV for _, rr := range resp.Answer { diff --git a/discovery/gossiper.go b/discovery/gossiper.go index 7ec7166f9..3910fed51 100644 --- a/discovery/gossiper.go +++ b/discovery/gossiper.go @@ -286,7 +286,7 @@ type cachedNetworkMsg struct { } // Size returns the "size" of an entry. We return the number of items as we -// just want to limit the total amount of entires rather than do accurate size +// just want to limit the total amount of entries rather than do accurate size // accounting. func (c *cachedNetworkMsg) Size() (uint64, error) { return uint64(len(c.msgs)), nil diff --git a/discovery/gossiper_test.go b/discovery/gossiper_test.go index ea76d6256..d3e1d1e5c 100644 --- a/discovery/gossiper_test.go +++ b/discovery/gossiper_test.go @@ -2329,8 +2329,8 @@ func TestProcessZombieEdgeNowLive(t *testing.T) { } // We'll also add the edge to our zombie index, provide a blank pubkey - // for the first node as we're simulating the sitaution where the first - // ndoe is updating but the second node isn't. In this case we only + // for the first node as we're simulating the situation where the first + // node is updating but the second node isn't. In this case we only // want to allow a new update from the second node to allow the entire // edge to be resurrected. chanID := batch.chanAnn.ShortChannelID @@ -2350,7 +2350,7 @@ func TestProcessZombieEdgeNowLive(t *testing.T) { } processAnnouncement(batch.chanUpdAnn1, true, true) - // At this point, the channel should still be consiered a zombie. + // At this point, the channel should still be considered a zombie. _, _, _, err = ctx.router.GetChannelByID(chanID) if err != channeldb.ErrZombieEdge { t.Fatalf("channel should still be a zombie") @@ -2448,7 +2448,7 @@ func TestReceiveRemoteChannelUpdateFirst(t *testing.T) { remotePeer := &mockPeer{remoteKey, sentMsgs, ctx.gossiper.quit} // Override NotifyWhenOnline to return the remote peer which we expect - // meesages to be sent to. + // messages to be sent to. ctx.gossiper.reliableSender.cfg.NotifyWhenOnline = func(peer [33]byte, peerChan chan<- lnpeer.Peer) { @@ -2645,7 +2645,7 @@ func TestExtraDataChannelAnnouncementValidation(t *testing.T) { // We'll now create an announcement that contains an extra set of bytes // that we don't know of ourselves, but should still include in the // final signature check. - extraBytes := []byte("gotta validate this stil!") + extraBytes := []byte("gotta validate this still!") ca, err := createRemoteChannelAnnouncement(0, extraBytes) if err != nil { t.Fatalf("can't create channel announcement: %v", err) @@ -2828,7 +2828,7 @@ func TestRetransmit(t *testing.T) { } remotePeer := &mockPeer{remoteKey, nil, nil} - // Process a local channel annoucement, channel update and node + // Process a local channel announcement, channel update and node // announcement. No messages should be broadcasted yet, since no proof // has been exchanged. assertProcessAnnouncement( @@ -2961,7 +2961,7 @@ func TestNodeAnnouncementNoChannels(t *testing.T) { } // Now add the node's channel to the graph by processing the channel - // announement and channel update. + // announcement and channel update. select { case err = <-ctx.gossiper.ProcessRemoteAnnouncement(batch.chanAnn, remotePeer): @@ -3002,7 +3002,7 @@ func TestNodeAnnouncementNoChannels(t *testing.T) { } } - // Processing the same node announement again should be ignored, as it + // Processing the same node announcement again should be ignored, as it // is stale. select { case err = <-ctx.gossiper.ProcessRemoteAnnouncement(batch.nodeAnn2, diff --git a/discovery/sync_manager.go b/discovery/sync_manager.go index 0535bac4b..ab0f0af83 100644 --- a/discovery/sync_manager.go +++ b/discovery/sync_manager.go @@ -220,7 +220,7 @@ func (m *SyncManager) syncerHandler() { initialHistoricalSyncer *GossipSyncer // initialHistoricalSyncSignal is a signal that will fire once - // the intiial historical sync has been completed. This is + // the initial historical sync has been completed. This is // crucial to ensure that another historical sync isn't // attempted just because the initialHistoricalSyncer was // disconnected. @@ -232,7 +232,7 @@ func (m *SyncManager) syncerHandler() { initialHistoricalSyncSignal = s.ResetSyncedSignal() // Restart the timer for our new historical sync peer. This will - // ensure that all initial syncers recevie an equivalent + // ensure that all initial syncers receive an equivalent // duration before attempting the next sync. Without doing so we // might attempt two historical sync back to back if a peer // disconnects just before the ticker fires. @@ -362,7 +362,7 @@ func (m *SyncManager) syncerHandler() { // Otherwise, our initialHistoricalSyncer corresponds to // the peer being disconnected, so we'll have to find a // replacement. - log.Debug("Finding replacement for intitial " + + log.Debug("Finding replacement for initial " + "historical sync") s := m.forceHistoricalSync() diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 41943ed75..68781dea9 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -459,7 +459,7 @@ below): `lnd` plus any application that consumes the RPC could cause `lnd` to miss crucial updates from the backend. - The default fee estimate mode in `bitcoind` is CONSERVATIVE. You can set - `bitcoind.estimatemode=ECONOMICAL` to change it into ECONOMICAL. Futhermore, + `bitcoind.estimatemode=ECONOMICAL` to change it into ECONOMICAL. Furthermore, if you start `bitcoind` in `regtest`, this configuration won't take any effect. diff --git a/docs/MAKEFILE.md b/docs/MAKEFILE.md index 9b7f5adbe..cf47a948a 100644 --- a/docs/MAKEFILE.md +++ b/docs/MAKEFILE.md @@ -179,7 +179,7 @@ Arguments: `unit-cover` ------------ -Runs the unit test suite with test coverage, compiling the statisitics in +Runs the unit test suite with test coverage, compiling the statistics in `profile.cov`. Arguments: diff --git a/docs/code_contribution_guidelines.md b/docs/code_contribution_guidelines.md index 9387aab57..fa4910149 100644 --- a/docs/code_contribution_guidelines.md +++ b/docs/code_contribution_guidelines.md @@ -12,7 +12,7 @@ 1. [Code Spacing](#code-spacing) 1. [Protobuf Compilation](#protobuf-compilation) 1. [Additional Style Constraints On Top of gofmt](#additional-style-constraints-on-top-of-gofmt) - 1. [Pointing to Remote Dependant Branches in Go Modules](#pointing-to-remote-dependant-branches-in-go-modules) + 1. [Pointing to Remote Dependent Branches in Go Modules](#pointing-to-remote-dependent-branches-in-go-modules) 1. [Use of Log Levels](#use-of-log-levels) 5. [Code Approval Process](#code-approval-process) 1. [Code Review](#code-review) @@ -546,7 +546,7 @@ to `gofmt` we've opted to enforce the following style guidelines. log and error messages, committers should attempt to minimize the number of lines utilized, while still adhering to the 80-character column limit. -## Pointing to Remote Dependant Branches in Go Modules +## Pointing to Remote Dependent Branches in Go Modules It's common that a developer may need to make a change in a dependent project of `lnd` such as `btcd`, `neutrino`, `btcwallet`, etc. In order to test changes diff --git a/docs/etcd.md b/docs/etcd.md index e15b80594..15cf4e299 100644 --- a/docs/etcd.md +++ b/docs/etcd.md @@ -2,7 +2,7 @@ With the recent introduction of the `kvdb` interface LND can support multiple database backends allowing experimentation with the storage model as well as -improving robustness trough eg. replicating essential data. +improving robustness through eg. replicating essential data. Building on `kvdb` in v0.11.0 we're adding experimental [etcd](https://etcd.io) support to LND. As this is an unstable feature heavily in development, it still @@ -71,7 +71,7 @@ db.etcd.keyfile=/home/user/etcd/bin/default.etcd/fixtures/client/key.pem db.etcd.insecure_skip_verify=true ``` -Optionally users can specifiy `db.etcd.user` and `db.etcd.pass` for db user +Optionally users can specify `db.etcd.user` and `db.etcd.pass` for db user authentication. If the database is shared, it is possible to separate our data from other users by setting `db.etcd.namespace` to an (already existing) etcd namespace. In order to test without TLS, users are able to set `db.etcd.disabletls` diff --git a/docs/leader_election.md b/docs/leader_election.md index af95ff713..91ca04db2 100644 --- a/docs/leader_election.md +++ b/docs/leader_election.md @@ -1,4 +1,4 @@ -# Increasing LND reliablity by clustering +# Increasing LND reliability by clustering Normally LND nodes use the embedded bbolt database to store all important states. This method of running has been proven to work well in a variety of environments, @@ -9,7 +9,7 @@ do updates and be more resilient to datacenter failures. It is now possible to store all essential state in a replicated etcd DB and to run multiple LND nodes on different machines where only one of them (the leader) is able to read and mutate the database. In such setup if the leader node fails -or decomissioned, a follower node will be elected as the new leader and will +or decommissioned, a follower node will be elected as the new leader and will quickly come online to minimize downtime. The leader election feature currently relies on etcd to work both for the election diff --git a/docs/recovery.md b/docs/recovery.md index ba1f29515..753100332 100644 --- a/docs/recovery.md +++ b/docs/recovery.md @@ -286,7 +286,7 @@ the same format. #### Streaming Updates via `SubscribeChannelBackups` -Using the gRPC interace directly, [a new call: +Using the gRPC interface directly, [a new call: `SubscribeChannelBackups`](https://api.lightning.community/#subscribechannelbackups). This call allows users to receive a new notification each time the underlying SCB state changes. This can be used to implement more complex backup diff --git a/docs/rest/websockets.md b/docs/rest/websockets.md index f2c85769a..f231075f1 100644 --- a/docs/rest/websockets.md +++ b/docs/rest/websockets.md @@ -53,7 +53,7 @@ ws.onmessage = function (event) { console.log(JSON.parse(event.data).result); } ws.onerror = function (event) { - // An error occured, let's log it to the console. + // An error occurred, let's log it to the console. console.log(event); } ``` diff --git a/feature/manager.go b/feature/manager.go index 9d5d1cad4..87c85f04a 100644 --- a/feature/manager.go +++ b/feature/manager.go @@ -33,7 +33,7 @@ type Config struct { // feature sets. type Manager struct { // fsets is a static map of feature set to raw feature vectors. Requests - // are fulfilled by cloning these interal feature vectors. + // are fulfilled by cloning these internal feature vectors. fsets map[Set]*lnwire.RawFeatureVector } diff --git a/funding/commitment_type_negotiation.go b/funding/commitment_type_negotiation.go index 1c8fe1a40..b3e9f38a9 100644 --- a/funding/commitment_type_negotiation.go +++ b/funding/commitment_type_negotiation.go @@ -112,7 +112,7 @@ func explicitNegotiateCommitmentType(channelType lnwire.ChannelType, // implicitNegotiateCommitmentType negotiates the commitment type of a channel // implicitly by choosing the latest type supported by the local and remote -// fetures. +// features. func implicitNegotiateCommitmentType(local, remote *lnwire.FeatureVector) (*lnwire.ChannelType, lnwallet.CommitmentType) { diff --git a/funding/manager.go b/funding/manager.go index a17b33e96..eed824792 100644 --- a/funding/manager.go +++ b/funding/manager.go @@ -2405,7 +2405,7 @@ func (f *Manager) waitForTimeout(completeChan *channeldb.OpenChannel, } // Close the timeout channel and exit if the block is - // aboce the max height. + // above the max height. if uint32(epoch.Height) >= maxHeight { log.Warnf("Waited for %v blocks without "+ "seeing funding transaction confirmed,"+ diff --git a/funding/manager_test.go b/funding/manager_test.go index bfd47329f..8b16437be 100644 --- a/funding/manager_test.go +++ b/funding/manager_test.go @@ -2584,7 +2584,7 @@ func TestFundingManagerPrivateRestart(t *testing.T) { } // TestFundingManagerCustomChannelParameters checks that custom requirements we -// specify during the channel funding flow is preserved correcly on both sides. +// specify during the channel funding flow is preserved correctly on both sides. func TestFundingManagerCustomChannelParameters(t *testing.T) { t.Parallel() @@ -2780,7 +2780,7 @@ func TestFundingManagerCustomChannelParameters(t *testing.T) { } // The max value in flight Alice can have should be maxValueAcceptChannel, - // which is the default value and the maxium Bob can offer should be + // which is the default value and the maximum Bob can offer should be // maxValueInFlight. if err := assertMaxHtlc(resCtx, maxValueAcceptChannel, maxValueInFlight); err != nil { diff --git a/htlcswitch/circuit_map.go b/htlcswitch/circuit_map.go index d5bb5f376..79028f879 100644 --- a/htlcswitch/circuit_map.go +++ b/htlcswitch/circuit_map.go @@ -438,7 +438,7 @@ func (cm *circuitMap) cleanClosedChannels() error { return ErrCorruptedCircuitMap } - // Delete the ciruit. + // Delete the circuit. for inKey := range circuitKeySet { if err := circuitBkt.Delete(inKey.Bytes()); err != nil { return err diff --git a/htlcswitch/interceptable_switch.go b/htlcswitch/interceptable_switch.go index 1e3405345..1148facb9 100644 --- a/htlcswitch/interceptable_switch.go +++ b/htlcswitch/interceptable_switch.go @@ -85,7 +85,7 @@ func (s *InterceptableSwitch) interceptForward(packet *htlcPacket, switch htlc := packet.htlc.(type) { case *lnwire.UpdateAddHTLC: - // We are not interested in intercepting initated payments. + // We are not interested in intercepting initiated payments. if packet.incomingChanID == hop.Source { return false } diff --git a/htlcswitch/link_test.go b/htlcswitch/link_test.go index 691f00e26..9bfd184cc 100644 --- a/htlcswitch/link_test.go +++ b/htlcswitch/link_test.go @@ -3507,7 +3507,7 @@ func TestChannelRetransmission(t *testing.T) { {"alice", "bob", &lnwire.RevokeAndAck{}, false}, // Proceed the payment farther by sending the - // fulfilment message and trigger the state + // fulfillment message and trigger the state // update. {"bob", "alice", &lnwire.UpdateFulfillHTLC{}, false}, {"bob", "alice", &lnwire.CommitSig{}, false}, @@ -3548,7 +3548,7 @@ func TestChannelRetransmission(t *testing.T) { {"bob", "alice", &lnwire.CommitSig{}, false}, // Proceed the payment farther by sending the - // fulfilment message and trigger the state + // fulfillment message and trigger the state // update. {"alice", "bob", &lnwire.RevokeAndAck{}, false}, {"bob", "alice", &lnwire.UpdateFulfillHTLC{}, false}, @@ -5980,7 +5980,7 @@ func newHodlInvoiceTestCtx(t *testing.T) (*hodlInvoiceTestCtx, error) { t.Fatal("timeout") case h := <-receiver.registry.settleChan: if hash != h { - t.Fatal("unexpect invoice settled") + t.Fatal("unexpected invoice settled") } } diff --git a/htlcswitch/mailbox.go b/htlcswitch/mailbox.go index 6bec19f39..bee7e12a5 100644 --- a/htlcswitch/mailbox.go +++ b/htlcswitch/mailbox.go @@ -91,7 +91,7 @@ type mailBoxConfig struct { // belongs to. shortChanID lnwire.ShortChannelID - // fetchUpdate retreives the most recent channel update for the channel + // fetchUpdate retrieves the most recent channel update for the channel // this mailbox belongs to. fetchUpdate func(lnwire.ShortChannelID) (*lnwire.ChannelUpdate, error) @@ -803,7 +803,7 @@ type mailOrchestrator struct { // chan_id -> short_chan_id // short_chan_id -> mailbox // so that Deliver can lookup mailbox directly once live, - // but still queriable by channel_id. + // but still queryable by channel_id. // unclaimedPackets maps a live short chan id to queue of packets if no // mailbox has been created. @@ -816,7 +816,7 @@ type mailOrchConfig struct { // properly exit during shutdown. forwardPackets func(chan struct{}, ...*htlcPacket) error - // fetchUpdate retreives the most recent channel update for the channel + // fetchUpdate retrieves the most recent channel update for the channel // this mailbox belongs to. fetchUpdate func(lnwire.ShortChannelID) (*lnwire.ChannelUpdate, error) diff --git a/htlcswitch/packet.go b/htlcswitch/packet.go index 78c3af8e2..f971ad90b 100644 --- a/htlcswitch/packet.go +++ b/htlcswitch/packet.go @@ -89,7 +89,7 @@ type htlcPacket struct { incomingTimeout uint32 // outgoingTimeout is the timeout of the proposed outgoing HTLC. This - // will be extraced from the hop payload recevived by the incoming + // will be extracted from the hop payload received by the incoming // link. outgoingTimeout uint32 diff --git a/htlcswitch/switch.go b/htlcswitch/switch.go index 99c46737a..8d594171e 100644 --- a/htlcswitch/switch.go +++ b/htlcswitch/switch.go @@ -290,7 +290,7 @@ type Switch struct { // blockEpochStream is an active block epoch event stream backed by an // active ChainNotifier instance. This will be used to retrieve the - // lastest height of the chain. + // latest height of the chain. blockEpochStream *chainntnfs.BlockEpochEvent // pendingSettleFails is the set of settle/fail entries that we need to diff --git a/htlcswitch/switch_test.go b/htlcswitch/switch_test.go index b68384500..ef9cc04ed 100644 --- a/htlcswitch/switch_test.go +++ b/htlcswitch/switch_test.go @@ -1546,7 +1546,7 @@ func TestCheckCircularForward(t *testing.T) { } // TestSkipIneligibleLinksMultiHopForward tests that if a multi-hop HTLC comes -// along, then we won't attempt to froward it down al ink that isn't yet able +// along, then we won't attempt to forward it down al ink that isn't yet able // to forward any HTLC's. func TestSkipIneligibleLinksMultiHopForward(t *testing.T) { tests := []multiHopFwdTest{ @@ -1601,7 +1601,7 @@ func TestSkipIneligibleLinksMultiHopForward(t *testing.T) { } // testSkipIneligibleLinksMultiHopForward tests that if a multi-hop HTLC comes -// along, then we won't attempt to froward it down al ink that isn't yet able +// along, then we won't attempt to forward it down al ink that isn't yet able // to forward any HTLC's. func testSkipIneligibleLinksMultiHopForward(t *testing.T, testCase *multiHopFwdTest) { @@ -2563,7 +2563,7 @@ func TestSwitchGetPaymentResult(t *testing.T) { t.Fatalf("unable to store result: %v", err) } - // The result should be availble. + // The result should be available. select { case res, ok := <-resultChan: if !ok { diff --git a/input/script_utils.go b/input/script_utils.go index 6a672a704..b7b19bd21 100644 --- a/input/script_utils.go +++ b/input/script_utils.go @@ -328,7 +328,7 @@ func SenderHTLCScript(senderHtlcKey, receiverHtlcKey, // HTLC to claim the output with knowledge of the revocation private key in the // scenario that the sender of the HTLC broadcasts a previously revoked // commitment transaction. A valid spend requires knowledge of the private key -// that corresponds to their revocation base point and also the private key fro +// that corresponds to their revocation base point and also the private key from // the per commitment point, and a valid signature under the combined public // key. func SenderHtlcSpendRevokeWithKey(signer Signer, signDesc *SignDescriptor, diff --git a/input/witnessgen.go b/input/witnessgen.go index 7d0f7fa73..fa0048a3f 100644 --- a/input/witnessgen.go +++ b/input/witnessgen.go @@ -84,7 +84,7 @@ const ( // us to sweep an HTLC output that we extended to a party, but was // never fulfilled. This _is_ the HTLC output directly on our // commitment transaction, and the input to the second-level HTLC - // tiemout transaction. It can only be spent after CLTV expiry, and + // timeout transaction. It can only be spent after CLTV expiry, and // commitment confirmation. HtlcOfferedTimeoutSecondLevelInputConfirmed StandardWitnessType = 15 diff --git a/invoices/invoice_expiry_watcher.go b/invoices/invoice_expiry_watcher.go index 9140d9862..b5ce2fe99 100644 --- a/invoices/invoice_expiry_watcher.go +++ b/invoices/invoice_expiry_watcher.go @@ -31,7 +31,7 @@ type invoiceExpiryTs struct { } // Less implements PriorityQueueItem.Less such that the top item in the -// priorty queue will be the one that expires next. +// priority queue will be the one that expires next. func (e invoiceExpiryTs) Less(other queue.PriorityQueueItem) bool { return e.Expiry.Before(other.(*invoiceExpiryTs).Expiry) } @@ -58,10 +58,10 @@ func (b invoiceExpiryHeight) expired(currentHeight, delta uint32) bool { return currentHeight+delta >= b.expiryHeight } -// InvoiceExpiryWatcher handles automatic invoice cancellation of expried +// InvoiceExpiryWatcher handles automatic invoice cancellation of expired // invoices. Upon start InvoiceExpiryWatcher will retrieve all pending (not yet -// settled or canceled) invoices invoices to its watcing queue. When a new -// invoice is added to the InvoiceRegistry, it'll be forarded to the +// settled or canceled) invoices invoices to its watching queue. When a new +// invoice is added to the InvoiceRegistry, it'll be forwarded to the // InvoiceExpiryWatcher and will end up in the watching queue as well. // If any of the watched invoices expire, they'll be removed from the watching // queue and will be cancelled through InvoiceRegistry.CancelInvoice(). diff --git a/invoices/invoiceregistry.go b/invoices/invoiceregistry.go index a72555fcf..f76b5191c 100644 --- a/invoices/invoiceregistry.go +++ b/invoices/invoiceregistry.go @@ -630,7 +630,7 @@ func (i *InvoiceRegistry) cancelSingleHtlc(invoiceRef channeldb.InvoiceRef, updateInvoice := func(invoice *channeldb.Invoice) ( *channeldb.InvoiceUpdateDesc, error) { - // Only allow individual htlc cancelation on open invoices. + // Only allow individual htlc cancellation on open invoices. if invoice.State != channeldb.ContractOpen { log.Debugf("cancelSingleHtlc: invoice %v no longer "+ "open", invoiceRef) @@ -669,7 +669,7 @@ func (i *InvoiceRegistry) cancelSingleHtlc(invoiceRef channeldb.InvoiceRef, htlcState = htlc.State } - // Cancelation is only possible if the htlc wasn't already + // Cancellation is only possible if the htlc wasn't already // resolved. if htlcState != channeldb.HtlcStateAccepted { log.Debugf("cancelSingleHtlc: htlc %v on invoice %v "+ @@ -1248,7 +1248,7 @@ func shouldCancel(state channeldb.ContractState, cancelAccepted bool) bool { } // If the invoice is accepted, we should only cancel if we want to - // force cancelation of accepted invoices. + // force cancellation of accepted invoices. return cancelAccepted } @@ -1396,7 +1396,7 @@ type InvoiceSubscription struct { // StartingInvoiceIndex field. NewInvoices chan *channeldb.Invoice - // SettledInvoices is a channel that we'll use to send all setted + // SettledInvoices is a channel that we'll use to send all settled // invoices with an invoices index greater than the specified // StartingInvoiceIndex field. SettledInvoices chan *channeldb.Invoice diff --git a/invoices/invoiceregistry_test.go b/invoices/invoiceregistry_test.go index b968fe073..dff66a7ce 100644 --- a/invoices/invoiceregistry_test.go +++ b/invoices/invoiceregistry_test.go @@ -183,10 +183,10 @@ func TestSettleInvoice(t *testing.T) { // Try to cancel. err = ctx.registry.CancelInvoice(testInvoicePaymentHash) if err != channeldb.ErrInvoiceAlreadySettled { - t.Fatal("expected cancelation of a settled invoice to fail") + t.Fatal("expected cancellation of a settled invoice to fail") } - // As this is a direct sette, we expect nothing on the hodl chan. + // As this is a direct settle, we expect nothing on the hodl chan. select { case <-hodlChan: t.Fatal("unexpected resolution") @@ -325,10 +325,10 @@ func testCancelInvoice(t *testing.T, gc bool) { require.Equal(t, testCurrentHeight, failResolution.AcceptHeight) } -// TestCancelInvoice tests cancelation of an invoice and related notifications. +// TestCancelInvoice tests cancellation of an invoice and related notifications. func TestCancelInvoice(t *testing.T) { // Test cancellation both with garbage collection (meaning that canceled - // invoice will be deleted) and without (meain it'll be kept). + // invoice will be deleted) and without (meaning it'll be kept). t.Run("garbage collect", func(t *testing.T) { testCancelInvoice(t, true) }) @@ -507,7 +507,7 @@ func TestSettleHoldInvoice(t *testing.T) { // Try to cancel. err = registry.CancelInvoice(testInvoicePaymentHash) if err == nil { - t.Fatal("expected cancelation of a settled invoice to fail") + t.Fatal("expected cancellation of a settled invoice to fail") } } @@ -1074,7 +1074,7 @@ func TestOldInvoiceRemovalOnStart(t *testing.T) { i := 0 for paymentHash, invoice := range existingInvoices.expiredInvoices { - // Mark half of the invoices as settled, the other hald as + // Mark half of the invoices as settled, the other half as // canceled. if i%2 == 0 { invoice.State = channeldb.ContractSettled @@ -1225,7 +1225,7 @@ func testHeightExpiryWithRegistry(t *testing.T, numParts int, settle bool) { } // If we did not settle the invoice before its expiry, we now expect - // a cancelation. + // a cancellation. expectedState := channeldb.ContractSettled if !settle { expectedState = channeldb.ContractCanceled diff --git a/invoices/update.go b/invoices/update.go index 77bb0dee5..6001efb30 100644 --- a/invoices/update.go +++ b/invoices/update.go @@ -286,7 +286,7 @@ type HTLCPreimages = map[channeldb.CircuitKey]lntypes.Preimage // verifies that all derived child hashes match the payment hashes of the HTLCs // in the set. This method is meant to be called after receiving the full amount // committed to via mpp_total_msat. This method will return a fail resolution if -// any of the child hashes fail to matche theire corresponding HTLCs. +// any of the child hashes fail to match their corresponding HTLCs. func reconstructAMPPreimages(ctx *invoiceUpdateCtx, htlcSet HTLCSet) (HTLCPreimages, *HtlcFailResolution) { diff --git a/lncfg/protocol.go b/lncfg/protocol.go index 86580d018..54ca3be99 100644 --- a/lncfg/protocol.go +++ b/lncfg/protocol.go @@ -9,7 +9,7 @@ package lncfg 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 - // nodes shuld always run with them on by default. + // nodes should always run with them on by default. LegacyProtocol `group:"legacy" namespace:"legacy"` // ExperimentalProtocol is a sub-config that houses any experimental diff --git a/lncfg/protocol_legacy_off.go b/lncfg/protocol_legacy_off.go index 4dc0a814c..028573e64 100644 --- a/lncfg/protocol_legacy_off.go +++ b/lncfg/protocol_legacy_off.go @@ -4,7 +4,7 @@ package lncfg // Legacy is a sub-config that houses all the legacy protocol options. These -// are mostly used for integration tests as most modern nodes shuld always run +// are mostly used for integration tests as most modern nodes should always run // with them on by default. type LegacyProtocol struct { } diff --git a/lncfg/protocol_legacy_on.go b/lncfg/protocol_legacy_on.go index 699f89411..80236c94e 100644 --- a/lncfg/protocol_legacy_on.go +++ b/lncfg/protocol_legacy_on.go @@ -4,7 +4,7 @@ package lncfg // Legacy is a sub-config that houses all the legacy protocol options. These -// are mostly used for integration tests as most modern nodes shuld always run +// are mostly used for integration tests as most modern nodes should always run // with them on by default. type LegacyProtocol struct { // LegacyOnionFormat if set to true, then we won't signal diff --git a/lncfg/protocol_rpctest.go b/lncfg/protocol_rpctest.go index 5630cf52b..25668c4c0 100644 --- a/lncfg/protocol_rpctest.go +++ b/lncfg/protocol_rpctest.go @@ -9,7 +9,7 @@ package lncfg 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 - // nodes shuld always run with them on by default. + // nodes should always run with them on by default. LegacyProtocol `group:"legacy" namespace:"legacy"` // ExperimentalProtocol is a sub-config that houses any experimental diff --git a/lnd.go b/lnd.go index dda5b939a..13d7fa254 100644 --- a/lnd.go +++ b/lnd.go @@ -645,7 +645,7 @@ func getTLSConfig(cfg *Config) ([]grpc.ServerOption, []grpc.DialOption, return nil, nil, nil, nil, err } - // We check whether the certifcate we have on disk match the IPs and + // We check whether the certificate we have on disk match the IPs and // domains specified by the config. If the extra IPs or domains have // changed from when the certificate was created, we will refresh the // certificate if auto refresh is active. diff --git a/lnrpc/autopilotrpc/driver.go b/lnrpc/autopilotrpc/driver.go index c62ecc1b4..850540df4 100644 --- a/lnrpc/autopilotrpc/driver.go +++ b/lnrpc/autopilotrpc/driver.go @@ -36,7 +36,7 @@ func createNewSubServer(configRegistry lnrpc.SubServerConfigDispatcher) ( } // Before we try to make the new service instance, we'll perform - // some sanity checks on the arguments to ensure that they're useable. + // some sanity checks on the arguments to ensure that they're usable. switch { case config.Manager == nil: return nil, nil, fmt.Errorf("Manager must be set to create " + diff --git a/lnrpc/routerrpc/driver.go b/lnrpc/routerrpc/driver.go index 0899464cb..4e9cea657 100644 --- a/lnrpc/routerrpc/driver.go +++ b/lnrpc/routerrpc/driver.go @@ -33,7 +33,7 @@ func createNewSubServer(configRegistry lnrpc.SubServerConfigDispatcher) ( } // Before we try to make the new router service instance, we'll perform - // some sanity checks on the arguments to ensure that they're useable. + // some sanity checks on the arguments to ensure that they're usable. switch { case config.Router == nil: return nil, nil, fmt.Errorf("Router must be set to create " + diff --git a/lnrpc/routerrpc/forward_interceptor.go b/lnrpc/routerrpc/forward_interceptor.go index e0b0d4ca8..96f94f75d 100644 --- a/lnrpc/routerrpc/forward_interceptor.go +++ b/lnrpc/routerrpc/forward_interceptor.go @@ -59,7 +59,7 @@ func newForwardInterceptor(server *Server, stream Router_HtlcInterceptorServer) } // run sends the intercepted packets to the client and receives the -// corersponding responses. On one hand it regsitered itself as an interceptor +// corersponding responses. On one hand it registered itself as an interceptor // that receives the switch packets and on the other hand launches a go routine // to read from the client stream. // To coordinate all this and make sure it is safe for concurrent access all diff --git a/lnrpc/routerrpc/router_backend.go b/lnrpc/routerrpc/router_backend.go index 24c280b5b..e9884c11f 100644 --- a/lnrpc/routerrpc/router_backend.go +++ b/lnrpc/routerrpc/router_backend.go @@ -132,7 +132,7 @@ type MissionControl interface { // QueryRoutes attempts to query the daemons' Channel Router for a possible // route to a target destination capable of carrying a specific amount of -// satoshis within the route's flow. The retuned route contains the full +// satoshis within the route's flow. The returned route contains the full // details required to craft and send an HTLC, also including the necessary // information that should be present within the Sphinx packet encapsulated // within the HTLC. diff --git a/lnrpc/routerrpc/router_server.go b/lnrpc/routerrpc/router_server.go index 007c40885..e1b34368e 100644 --- a/lnrpc/routerrpc/router_server.go +++ b/lnrpc/routerrpc/router_server.go @@ -666,7 +666,7 @@ func getMsatPairValue(msatValue lnwire.MilliSatoshi, return msatValue, nil } - // If we have no msatValue, we can just return our sate value even if + // If we have no msatValue, we can just return our state value even if // it is zero, because it's impossible that we have mismatched values. if msatValue == 0 { return lnwire.MilliSatoshi(satValue * 1000), nil @@ -879,7 +879,7 @@ func (s *Server) SubscribeHtlcEvents(req *SubscribeHtlcEventsRequest, // requests to the caller. // Upon connection it does the following: // 1. Check if there is already a live stream, if yes it rejects the request. -// 2. Regsitered a ForwardInterceptor +// 2. Registered a ForwardInterceptor // 3. Delivers to the caller every √√ and detect his answer. // It uses a local implementation of holdForwardsStore to keep all the hold // forwards and find them when manual resolution is later needed. diff --git a/lnrpc/signrpc/driver.go b/lnrpc/signrpc/driver.go index e000c5635..01b07d60c 100644 --- a/lnrpc/signrpc/driver.go +++ b/lnrpc/signrpc/driver.go @@ -36,7 +36,7 @@ func createNewSubServer(configRegistry lnrpc.SubServerConfigDispatcher) ( } // Before we try to make the new signer service instance, we'll perform - // some sanity checks on the arguments to ensure that they're useable. + // some sanity checks on the arguments to ensure that they're usable. switch { // If the macaroon service is set (we should use macaroons), then diff --git a/lnrpc/walletrpc/driver.go b/lnrpc/walletrpc/driver.go index 79972f7db..7446470f1 100644 --- a/lnrpc/walletrpc/driver.go +++ b/lnrpc/walletrpc/driver.go @@ -37,7 +37,7 @@ func createNewSubServer(configRegistry lnrpc.SubServerConfigDispatcher) ( // Before we try to make the new WalletKit service instance, we'll // perform some sanity checks on the arguments to ensure that they're - // useable. + // usable. switch { case config.MacService != nil && config.NetworkDir == "": return nil, nil, fmt.Errorf("NetworkDir must be set to " + diff --git a/lnrpc/watchtowerrpc/handler.go b/lnrpc/watchtowerrpc/handler.go index 4aacea1be..23e7ac64e 100644 --- a/lnrpc/watchtowerrpc/handler.go +++ b/lnrpc/watchtowerrpc/handler.go @@ -175,7 +175,7 @@ func (c *Handler) GetInfo(ctx context.Context, } // isActive returns nil if the tower backend is initialized, and the Handler can -// proccess RPC requests. +// process RPC requests. func (c *Handler) isActive() error { if c.cfg.Active { return nil diff --git a/lnrpc/wtclientrpc/driver.go b/lnrpc/wtclientrpc/driver.go index cecbbf434..62a18cffc 100644 --- a/lnrpc/wtclientrpc/driver.go +++ b/lnrpc/wtclientrpc/driver.go @@ -34,7 +34,7 @@ func createNewSubServer(configRegistry lnrpc.SubServerConfigDispatcher) ( } // Before we try to make the new service instance, we'll perform - // some sanity checks on the arguments to ensure that they're useable. + // some sanity checks on the arguments to ensure that they're usable. switch { case config.Resolver == nil: return nil, nil, errors.New("a lncfg.TCPResolver is required") diff --git a/lntest/harness_node.go b/lntest/harness_node.go index d678d863b..fbda4c219 100644 --- a/lntest/harness_node.go +++ b/lntest/harness_node.go @@ -819,7 +819,7 @@ func (hn *HarnessNode) Init( initReq.StatelessInit, response.AdminMacaroon, ) if err != nil { - return nil, fmt.Errorf("faied to init: %w", err) + return nil, fmt.Errorf("failed to init: %w", err) } return response, nil diff --git a/lntest/itest/lnd_amp_test.go b/lntest/itest/lnd_amp_test.go index e5bbea0fc..62797d343 100644 --- a/lntest/itest/lnd_amp_test.go +++ b/lntest/itest/lnd_amp_test.go @@ -163,7 +163,7 @@ func testSendPaymentAMPInvoiceCase(net *lntest.NetworkHarness, t *harnessTest, require.NoError(t.t, err) // Also fetch Bob's invoice from ListInvoices and assert it is equal to - // the one recevied via the subscription. + // the one received via the subscription. invoiceResp, err := ctx.bob.ListInvoices( ctxb, &lnrpc.ListInvoiceRequest{}, ) @@ -695,7 +695,7 @@ func testSendToRouteAMP(net *lntest.NetworkHarness, t *harnessTest) { require.NoError(t.t, err) // Also fetch Bob's invoice from ListInvoices and assert it is equal to - // the one recevied via the subscription. + // the one received via the subscription. invoiceResp, err := ctx.bob.ListInvoices( ctxb, &lnrpc.ListInvoiceRequest{}, ) diff --git a/lntest/itest/lnd_channel_force_close_test.go b/lntest/itest/lnd_channel_force_close_test.go index 5a9c6e207..9bc36e932 100644 --- a/lntest/itest/lnd_channel_force_close_test.go +++ b/lntest/itest/lnd_channel_force_close_test.go @@ -1199,7 +1199,7 @@ func channelForceClosureTest(net *lntest.NetworkHarness, t *harnessTest, } } - // Check that each HTLC output was spent exactly onece. + // Check that each HTLC output was spent exactly once. for op, num := range htlcTxOutpointSet { if num != 1 { t.Fatalf("HTLC outpoint %v was spent %v times", op, num) diff --git a/lntest/itest/lnd_channel_graph_test.go b/lntest/itest/lnd_channel_graph_test.go index 3df424ce6..6445531b7 100644 --- a/lntest/itest/lnd_channel_graph_test.go +++ b/lntest/itest/lnd_channel_graph_test.go @@ -393,7 +393,7 @@ func testGraphTopologyNtfns(net *lntest.NetworkHarness, t *harnessTest, pinned b // Bob stimmy. net.SendCoins(t.t, btcutil.SatoshiPerBitcoin, bob) - // Assert that Bob has the correct sync type before proceeeding. + // Assert that Bob has the correct sync type before proceeding. if pinned { assertSyncType(t, alice, bobPubkey, lnrpc.Peer_PINNED_SYNC) } else { @@ -426,7 +426,7 @@ func testGraphTopologyNtfns(net *lntest.NetworkHarness, t *harnessTest, pinned b // Ensure that a new update for both created edges is properly // dispatched to our registered client. case graphUpdate := <-graphSub.updateChan: - // Process all channel updates prsented in this update + // Process all channel updates presented in this update // message. for _, chanUpdate := range graphUpdate.ChannelUpdates { switch chanUpdate.AdvertisingNode { diff --git a/lntest/itest/lnd_channel_policy_test.go b/lntest/itest/lnd_channel_policy_test.go index b716ade25..f8426b211 100644 --- a/lntest/itest/lnd_channel_policy_test.go +++ b/lntest/itest/lnd_channel_policy_test.go @@ -807,7 +807,7 @@ func testUpdateChannelPolicyForPrivateChannel(net *lntest.NetworkHarness, assertAmountPaid(t, "Bob(local) [private=>] Carol(remote)", net.Bob, bobFundPoint, paymentAmt, 0) - // Calcuate the amount in satoshis. + // Calculate the amount in satoshis. amtExpected := int64(paymentAmt + baseFeeMSat/1000) // Bob should have received 20k satoshis + fee from Alice. diff --git a/lntest/itest/lnd_forward_interceptor_test.go b/lntest/itest/lnd_forward_interceptor_test.go index c24c25ac2..da0f7def9 100644 --- a/lntest/itest/lnd_forward_interceptor_test.go +++ b/lntest/itest/lnd_forward_interceptor_test.go @@ -424,7 +424,7 @@ func testForwardInterceptorBasic(net *lntest.NetworkHarness, t *harnessTest) { }) return err == nil && len(channels.Channels) > 0 }, defaultTimeout) - require.NoError(t.t, err, "alice <> bob channel didnt re-activate") + require.NoError(t.t, err, "alice <> bob channel didn't re-activate") } diff --git a/lntest/itest/lnd_funding_test.go b/lntest/itest/lnd_funding_test.go index 49dae9246..40d832bc6 100644 --- a/lntest/itest/lnd_funding_test.go +++ b/lntest/itest/lnd_funding_test.go @@ -213,7 +213,7 @@ func basicChannelFundingTest(t *harnessTest, net *lntest.NetworkHarness, require.NoError(t.t, err, "bob didn't report channel") cType, err := channelCommitType(alice, chanPoint) - require.NoError(t.t, err, "unable to get channnel type") + require.NoError(t.t, err, "unable to get channel type") // With the channel open, ensure that the amount specified above has // properly been pushed to Bob. diff --git a/lntest/itest/lnd_hold_invoice_force_test.go b/lntest/itest/lnd_hold_invoice_force_test.go index b8b176246..7fd911d16 100644 --- a/lntest/itest/lnd_hold_invoice_force_test.go +++ b/lntest/itest/lnd_hold_invoice_force_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/require" ) -// testHoldInvoiceForceClose tests cancelation of accepted hold invoices which +// testHoldInvoiceForceClose tests cancellation of accepted hold invoices which // would otherwise trigger force closes when they expire. func testHoldInvoiceForceClose(net *lntest.NetworkHarness, t *harnessTest) { ctxb, cancel := context.WithCancel(context.Background()) diff --git a/lntest/itest/lnd_hold_persistence_test.go b/lntest/itest/lnd_hold_persistence_test.go index e92086ca5..f60121742 100644 --- a/lntest/itest/lnd_hold_persistence_test.go +++ b/lntest/itest/lnd_hold_persistence_test.go @@ -289,7 +289,7 @@ func testHoldInvoicePersistence(net *lntest.NetworkHarness, t *harnessTest) { payment.Status) } case <-time.After(5 * time.Second): - t.Fatalf("in flight status not recevied") + t.Fatalf("in flight status not received") } } @@ -341,7 +341,7 @@ func testHoldInvoicePersistence(net *lntest.NetworkHarness, t *harnessTest) { payment = p case <-time.After(5 * time.Second): - t.Fatalf("in flight status not recevied") + t.Fatalf("in flight status not received") } } diff --git a/lntest/itest/lnd_misc_test.go b/lntest/itest/lnd_misc_test.go index 1f3873125..b96d588f3 100644 --- a/lntest/itest/lnd_misc_test.go +++ b/lntest/itest/lnd_misc_test.go @@ -1094,7 +1094,7 @@ func testDataLossProtection(net *lntest.NetworkHarness, t *harnessTest) { daveBalance := daveBalResp.ConfirmedBalance if daveBalance <= daveStartingBalance { return fmt.Errorf("expected dave to have balance "+ - "above %d, intead had %v", daveStartingBalance, + "above %d, instead had %v", daveStartingBalance, daveBalance) } diff --git a/lntest/itest/lnd_multi-hop_htlc_local_chain_claim_test.go b/lntest/itest/lnd_multi-hop_htlc_local_chain_claim_test.go index 60e9aa7f8..a7beae81d 100644 --- a/lntest/itest/lnd_multi-hop_htlc_local_chain_claim_test.go +++ b/lntest/itest/lnd_multi-hop_htlc_local_chain_claim_test.go @@ -168,7 +168,7 @@ func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest, err = restartBob() require.NoError(t.t, err) - // After the force close transacion is mined, transactions will be + // After the force close transaction is mined, transactions will be // broadcast by both Bob and Carol. switch c { // Carol will broadcast her second level HTLC transaction and Bob will diff --git a/lntest/itest/lnd_multi-hop_htlc_remote_chain_claim_test.go b/lntest/itest/lnd_multi-hop_htlc_remote_chain_claim_test.go index f1dee3435..e1a835514 100644 --- a/lntest/itest/lnd_multi-hop_htlc_remote_chain_claim_test.go +++ b/lntest/itest/lnd_multi-hop_htlc_remote_chain_claim_test.go @@ -184,7 +184,7 @@ func testMultiHopHtlcRemoteChainClaim(net *lntest.NetworkHarness, t *harnessTest err = restartBob() require.NoError(t.t, err) - // After the force close transacion is mined, we should expect Bob and + // After the force close transaction is mined, we should expect Bob and // Carol to broadcast some transactions depending on the channel // commitment type. switch c { diff --git a/lntest/itest/lnd_wipe_fwdpkgs_test.go b/lntest/itest/lnd_wipe_fwdpkgs_test.go index 8ff6da685..7b4b96907 100644 --- a/lntest/itest/lnd_wipe_fwdpkgs_test.go +++ b/lntest/itest/lnd_wipe_fwdpkgs_test.go @@ -52,7 +52,7 @@ func testWipeForwardingPackages(net *lntest.NetworkHarness, // close channel should now become pending force closed channel. pendingChan = assertPendingForceClosedChannel(t.t, net.Bob) - // Check the forwarding pacakges are deleted. + // Check the forwarding packages are deleted. require.Zero(t.t, pendingChan.NumForwardingPackages) // For Alice, the forwarding packages should have been wiped too. @@ -87,7 +87,7 @@ func testWipeForwardingPackages(net *lntest.NetworkHarness, // really contains is channels whose closing tx has been broadcast. pendingChan = assertPendingForceClosedChannel(t.t, net.Bob) - // Check the forwarding pacakges are deleted. + // Check the forwarding packages are deleted. require.Zero(t.t, pendingChan.NumForwardingPackages) // Mine a block to confirm sweep transactions such that they diff --git a/lnwallet/channel.go b/lnwallet/channel.go index ac72852d5..ea6d185a5 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -2024,7 +2024,7 @@ func (lc *LightningChannel) restorePendingRemoteUpdates( logIdx) } - // We previously restored Adds along with all the other upates, + // We previously restored Adds along with all the other updates, // but this Add restoration was a no-op as every single one of // these Adds was already restored since they're all incoming // htlcs on the local commitment. @@ -2143,7 +2143,7 @@ func (lc *LightningChannel) restorePendingLocalUpdates( } // At this point the restored update's logIndex must be equal - // to the update log, otherwise somthing is horribly wrong. + // to the update log, otherwise something is horribly wrong. if payDesc.LogIndex != lc.localUpdateLog.logIndex { panic(fmt.Sprintf("log index mismatch: "+ "%v vs %v", payDesc.LogIndex, @@ -3460,7 +3460,7 @@ func (lc *LightningChannel) validateCommitmentSanity(theirLogCounter, } // Now that we know the total value of added HTLCs, we check - // that this satisfy the MaxPendingAmont contraint. + // that this satisfy the MaxPendingAmont constraint. if amtInFlight > constraints.MaxPendingAmount { return ErrMaxPendingAmount } @@ -6780,7 +6780,7 @@ func (lc *LightningChannel) availableCommitmentBalance(view *htlcView, // than the htlcCommitFee, where we could still be sending dust // HTLCs, but we return 0 in this case. This is to avoid // lowering our balance even further, as this takes us into a - // bad state wehere neither we nor our channel counterparty can + // bad state where neither we nor our channel counterparty can // add HTLCs. if ourBalance < htlcCommitFee { return 0, commitWeight diff --git a/lnwallet/channel_test.go b/lnwallet/channel_test.go index f3b06b655..030320ffc 100644 --- a/lnwallet/channel_test.go +++ b/lnwallet/channel_test.go @@ -654,7 +654,7 @@ func testCommitHTLCSigTieBreak(t *testing.T, restart bool) { lastIndex = htlc.OutputIndex } - // If requsted, restart Alice so that we can test that the necessary + // If requested, restart Alice so that we can test that the necessary // indexes can be reconstructed before needing to validate the // signatures from Bob. if restart { @@ -1172,7 +1172,7 @@ func TestForceCloseDustOutput(t *testing.T) { defer cleanUp() // We set both node's channel reserves to 0, to make sure - // they can create small dust ouputs without going under + // they can create small dust outputs without going under // their channel reserves. aliceChannel.channelState.LocalChanCfg.ChanReserve = 0 bobChannel.channelState.LocalChanCfg.ChanReserve = 0 @@ -5427,7 +5427,7 @@ func TestChanCommitWeightDustHtlcs(t *testing.T) { return w } - // Start by getting the initial remote commitment wight seen from + // Start by getting the initial remote commitment weight seen from // Alice's perspective. At this point there are no HTLCs on the // commitment. weight1 := remoteCommitWeight(aliceChannel) @@ -5438,7 +5438,7 @@ func TestChanCommitWeightDustHtlcs(t *testing.T) { bobDustHtlc := bobDustlimit + htlcSuccessFee - 1 preimg := addHtlc(bobDustHtlc) - // Now get the current wight of the remote commitment. We expect it to + // Now get the current weight of the remote commitment. We expect it to // not have changed, since the HTLC we added is considered dust. weight2 := remoteCommitWeight(aliceChannel) require.Equal(t, weight1, weight2) @@ -5711,7 +5711,7 @@ func TestLockedInHtlcForwardingSkipAfterRestart(t *testing.T) { t.Fatalf("unable to restart bob: %v", err) } - // Readd the Fail to both Alice and Bob's channels, as the non-committed + // Re-add the Fail to both Alice and Bob's channels, as the non-committed // update will not have survived the restart. err = bobChannel.FailHTLC(htlc2.ID, []byte("failreason"), nil, nil, nil) if err != nil { @@ -5723,7 +5723,7 @@ func TestLockedInHtlcForwardingSkipAfterRestart(t *testing.T) { } // Have Alice initiate a state transition, which does not include the - // HTLCs just readded to the channel state. + // HTLCs just re-added to the channel state. aliceSig, aliceHtlcSigs, _, err = aliceChannel.SignNextCommitment() if err != nil { t.Fatal(err) @@ -6808,7 +6808,7 @@ func TestChanReserveRemoteInitiator(t *testing.T) { // Set Alice's channel reserve to be 5 BTC-commitfee. This means she // has just enough balance to cover the comitment fee, but not enough // to add any more HTLCs to the commitment. Although a reserve this - // high is unrealistic, a channel can easiliy get into a situation + // high is unrealistic, a channel can easily get into a situation // where the initiator cannot pay for the fee of any more HTLCs. commitFee := aliceChannel.channelState.LocalCommitment.CommitFee aliceMinReserve := 5*btcutil.SatoshiPerBitcoin - commitFee @@ -7203,7 +7203,7 @@ func TestChannelRestoreUpdateLogs(t *testing.T) { // signature from Bob yet. _, _, _, _, err = aliceChannel.ReceiveRevocation(bobRevocation) if err != nil { - t.Fatalf("unable to recive revocation: %v", err) + t.Fatalf("unable to receive revocation: %v", err) } // Now make Alice send and sign an additional HTLC. We don't let Bob @@ -7709,7 +7709,7 @@ func TestChannelRestoreCommitHeight(t *testing.T) { // Alice receives the revocation, ACKing her pending commitment. _, _, _, _, err = aliceChannel.ReceiveRevocation(bobRevocation) if err != nil { - t.Fatalf("unable to recive revocation: %v", err) + t.Fatalf("unable to receive revocation: %v", err) } // However, the HTLC is still not locked into her local commitment, so @@ -7726,7 +7726,7 @@ func TestChannelRestoreCommitHeight(t *testing.T) { } // At this stage Bob has a pending remote commitment. Make sure - // restoring at this stage correcly restores the HTLC add commit + // restoring at this stage correctly restores the HTLC add commit // heights. bobChannel = restoreAndAssertCommitHeights(t, bobChannel, true, 0, 1, 1) @@ -7746,7 +7746,7 @@ func TestChannelRestoreCommitHeight(t *testing.T) { _, _, _, _, err = bobChannel.ReceiveRevocation(aliceRevocation) if err != nil { - t.Fatalf("unable to recive revocation: %v", err) + t.Fatalf("unable to receive revocation: %v", err) } // Alice ACKing Bob's pending commitment shouldn't change the heights @@ -7790,7 +7790,7 @@ func TestChannelRestoreCommitHeight(t *testing.T) { } // Since Bob just revoked another commitment, a restoration should - // increase the add height of the firt HTLC to 2, as we only keep the + // increase the add height of the first HTLC to 2, as we only keep the // last unrevoked commitment. The new HTLC will also have a local add // height of 2. bobChannel = restoreAndAssertCommitHeights(t, bobChannel, true, 0, 2, 1) diff --git a/lnwallet/commitment.go b/lnwallet/commitment.go index 08cf96245..9c9b98254 100644 --- a/lnwallet/commitment.go +++ b/lnwallet/commitment.go @@ -193,7 +193,7 @@ type ScriptInfo struct { // CommitScriptToSelf constructs the public key script for the output on the // commitment transaction paying to the "owner" of said commitment transaction. // The `initiator` argument should correspond to the owner of the commitment -// tranasction which we are generating the to_local script for. If the other +// transaction which we are generating the to_local script for. If the other // party learns of the preimage to the revocation hash, then they can claim all // the settled funds in the channel, plus the unsettled funds. func CommitScriptToSelf(chanType channeldb.ChannelType, initiator bool, @@ -234,7 +234,7 @@ func CommitScriptToSelf(chanType channeldb.ChannelType, initiator bool, // CommitScriptToRemote derives the appropriate to_remote script based on the // channel's commitment type. The `initiator` argument should correspond to the -// owner of the commitment tranasction which we are generating the to_remote +// owner of the commitment transaction which we are generating the to_remote // script for. The second return value is the CSV delay of the output script, // what must be satisfied in order to spend the output. func CommitScriptToRemote(chanType channeldb.ChannelType, initiator bool, @@ -340,7 +340,7 @@ func HtlcSecondLevelInputSequence(chanType channeldb.ChannelType) uint32 { // output for the second-level HTLC transactions. The second level transaction // act as a sort of covenant, ensuring that a 2-of-2 multi-sig output can only // be spent in a particular way, and to a particular output. The `initiator` -// argument should correspond to the owner of the commitment tranasction which +// argument should correspond to the owner of the commitment transaction which // we are generating the to_local script for. func SecondLevelHtlcScript(chanType channeldb.ChannelType, initiator bool, revocationKey, delayKey *btcec.PublicKey, @@ -725,7 +725,7 @@ func (cb *CommitmentBuilder) createUnsignedCommitmentTx(ourBalance, // spent after a relative block delay or revocation event, and a remote output // paying the counterparty within the channel, which can be spent immediately // or after a delay depending on the commitment type. The `initiator` argument -// should correspond to the owner of the commitment tranasction we are creating. +// should correspond to the owner of the commitment transaction we are creating. func CreateCommitTx(chanType channeldb.ChannelType, fundingOutput wire.TxIn, keyRing *CommitmentKeyRing, localChanCfg, remoteChanCfg *channeldb.ChannelConfig, diff --git a/lnwallet/wallet.go b/lnwallet/wallet.go index 0624c236c..284d58723 100644 --- a/lnwallet/wallet.go +++ b/lnwallet/wallet.go @@ -1221,7 +1221,7 @@ func (l *LightningWallet) handleFundingCancelRequest(req *fundingReserveCancelMs pendingReservation.Lock() defer pendingReservation.Unlock() - // Mark all previously locked outpoints as useable for future funding + // Mark all previously locked outpoints as usable for future funding // requests. for _, unusedInput := range pendingReservation.ourContribution.Inputs { delete(l.lockedOutPoints, unusedInput.PreviousOutPoint) diff --git a/mobile/README.md b/mobile/README.md index 22bb80e89..cfe0cc0c0 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -223,7 +223,7 @@ If Android Studio tells you that the `aar` file cannot be included into the `app ![separate_gradle_module](docs/separate_gradle_module.png) -3. Gradle file should countain only these lines: +3. Gradle file should contain only these lines: ```shell configurations.maybeCreate("default") diff --git a/mobile/bindings.go b/mobile/bindings.go index 141955763..17252953d 100644 --- a/mobile/bindings.go +++ b/mobile/bindings.go @@ -16,7 +16,7 @@ import ( "google.golang.org/grpc" ) -// lndStarted will be used atomically to ensure only a singel lnd instance is +// lndStarted will be used atomically to ensure only a single lnd instance is // attempted to be started at once. var lndStarted int32 diff --git a/nat/traversal.go b/nat/traversal.go index 852a28cb6..9ae407320 100644 --- a/nat/traversal.go +++ b/nat/traversal.go @@ -7,7 +7,7 @@ import ( var ( // private24BitBlock contains the set of private IPv4 addresses within - // the 10.0.0.0/8 adddress space. + // the 10.0.0.0/8 address space. private24BitBlock *net.IPNet // private20BitBlock contains the set of private IPv4 addresses within diff --git a/netann/chan_status_manager.go b/netann/chan_status_manager.go index cb76c9392..fc2b94c05 100644 --- a/netann/chan_status_manager.go +++ b/netann/chan_status_manager.go @@ -69,12 +69,12 @@ type ChanStatusConfig struct { Graph ChannelGraph // ChanEnableTimeout is the duration a peer's connect must remain stable - // before attempting to reenable the channel. + // before attempting to re-enable the channel. // // NOTE: This value is only used to verify that the relation between // itself, ChanDisableTimeout, and ChanStatusSampleInterval is correct. // The user is still responsible for ensuring that the same duration - // elapses before attempting to reenable a channel. + // elapses before attempting to re-enable a channel. ChanEnableTimeout time.Duration // ChanDisableTimeout is the duration the manager will wait after @@ -138,7 +138,7 @@ func NewChanStatusManager(cfg *ChanStatusConfig) (*ChanStatusManager, error) { // enable_timeout + sample_interval to be less than or equal to the // disable_timeout and that all are positive values. A peer that // disconnects and reconnects quickly may cause a disable update to be - // sent, shortly followed by a reenable. Ensuring a healthy separation + // sent, shortly followed by a re-enable. Ensuring a healthy separation // helps dampen the possibility of spamming updates that toggle the // disable bit for such events. if cfg.ChanStatusSampleInterval <= 0 { @@ -492,7 +492,7 @@ func (m *ChanStatusManager) processAutoRequest(outpoint wire.OutPoint) error { // scheduled. Once an active channel is determined to be pending-inactive, one // of two transitions can follow. Either the channel is disabled because no // request to enable is received before the scheduled disable is broadcast, or -// the channel is successfully reenabled and channel is returned to an active +// the channel is successfully re-enabled and channel is returned to an active // state from the POV of the ChanStatusManager. func (m *ChanStatusManager) markPendingInactiveChannels() { channels, err := m.fetchChannels() diff --git a/netann/chan_status_manager_test.go b/netann/chan_status_manager_test.go index 3e9cd6662..3b667472c 100644 --- a/netann/chan_status_manager_test.go +++ b/netann/chan_status_manager_test.go @@ -651,7 +651,7 @@ var stateMachineTests = []stateMachineTest{ time.Sleep(100 * time.Millisecond) // Simulate reconnect by making channels active. h.markActive(h.graph.chans()) - // Request that all channels be reenabled. + // Request that all channels be re-enabled. h.assertEnables(h.graph.chans(), nil, false) // Pending disable should have been canceled, and // no updates sent. Channels remain enabled on the diff --git a/netann/channel_state.go b/netann/channel_state.go index 123a586b8..904196331 100644 --- a/netann/channel_state.go +++ b/netann/channel_state.go @@ -20,7 +20,7 @@ const ( // detected in an inactive state. Channels in this state will have a // disabling announcement sent after the ChanInactiveTimeout expires // from the time of the first detection--unless the channel is - // explicitly reenabled before the disabling occurs. + // explicitly re-enabled before the disabling occurs. ChanStatusPendingDisabled // ChanStatusDisabled indicates that the channel's last announcement has diff --git a/peer/brontide.go b/peer/brontide.go index 51d2dc325..9595bf285 100644 --- a/peer/brontide.go +++ b/peer/brontide.go @@ -1151,7 +1151,7 @@ func (ms *msgStream) msgConsumer() { // concurrent access. func (ms *msgStream) AddMsg(msg lnwire.Message) { // First, we'll attempt to receive from the producerSema struct. This - // acts as a sempahore to prevent us from indefinitely buffering + // acts as a semaphore to prevent us from indefinitely buffering // incoming items from the wire. Either the msg queue isn't full, and // we'll not block, or the queue is full, and we'll block until either // we're signalled to quit, or a slot is freed up. @@ -2142,7 +2142,7 @@ func (p *Brontide) ChannelSnapshots() []*channeldb.ChannelSnapshot { } // We'll only return a snapshot for channels that are - // *immedately* available for routing payments over. + // *immediately* available for routing payments over. if activeChan.RemoteNextRevocation() == nil { continue } diff --git a/peer/brontide_test.go b/peer/brontide_test.go index a84e19581..a8623c48e 100644 --- a/peer/brontide_test.go +++ b/peer/brontide_test.go @@ -876,7 +876,7 @@ func TestCustomShutdownScript(t *testing.T) { // If the test has not specified an expected address, do not check // whether the shutdown address matches. This covers the case where - // we epect shutdown to a random address and cannot match it. + // we expect shutdown to a random address and cannot match it. if len(test.expectedScript) == 0 { return } diff --git a/pool/worker.go b/pool/worker.go index 9fc2f84e0..6aed815cc 100644 --- a/pool/worker.go +++ b/pool/worker.go @@ -28,7 +28,7 @@ type ( Cleanup() } - // WorkerConfig parameterizes the behavior of a Worker pool. + // WorkerConfig parametrizes the behavior of a Worker pool. WorkerConfig struct { // NewWorkerState allocates a new state for a worker goroutine. // This method is called each time a new worker goroutine is @@ -60,10 +60,10 @@ type ( requests chan *request // work is a channel where new tasks are submitted, but is only - // read by active worker gorotuines. + // read by active worker goroutines. work chan *request - // workerSem is a channel-based sempahore that is used to limit + // workerSem is a channel-based semaphore that is used to limit // the total number of worker goroutines to the number // prescribed by the WorkerConfig. workerSem chan struct{} diff --git a/queue/gc_queue.go b/queue/gc_queue.go index 965e841dd..04972b13b 100644 --- a/queue/gc_queue.go +++ b/queue/gc_queue.go @@ -158,10 +158,10 @@ func (q *GCQueue) queueManager() { // recycle ticker to cleanup any entries that go unused. q.recycleTicker.Resume() - // If the recycle ticker fires, we will aggresively release any + // If the recycle ticker fires, we will aggressively release any // write buffers in the freelist for which the expiryInterval // has elapsed since their insertion. If after doing so, no - // elements remain, we will pause the recylce ticker. + // elements remain, we will pause the recycle ticker. case <-q.recycleTicker.Ticks(): // Since the insert time of all entries will be // monotonically increasing, iterate over elements and diff --git a/record/amp.go b/record/amp.go index 6deb40426..eb431fec3 100644 --- a/record/amp.go +++ b/record/amp.go @@ -66,8 +66,8 @@ const ( // bytes, leaving only the root_share and set_id. minAMPLength = 64 - // maxAMPLength is the maximum legnth of a serialized AMP TLV record, - // which occurs when the truncated endoing of a child_index takes 2 + // maxAMPLength is the maximum length of a serialized AMP TLV record, + // which occurs when the truncated encoding of a child_index takes 2 // bytes. maxAMPLength = 68 ) @@ -100,7 +100,7 @@ func (a *AMP) PayloadSize() uint64 { return 32 + 32 + tlv.SizeTUint32(a.childIndex) } -// String returns a human-readble description of the amp payload fields. +// String returns a human-readable description of the amp payload fields. func (a *AMP) String() string { if a == nil { return "" diff --git a/record/hop.go b/record/hop.go index 3f515e6b0..9462714d3 100644 --- a/record/hop.go +++ b/record/hop.go @@ -5,11 +5,11 @@ import ( ) const ( - // AmtOnionType is the type used in the onion to refrence the amount to + // AmtOnionType is the type used in the onion to reference the amount to // send to the next hop. AmtOnionType tlv.Type = 2 - // LockTimeTLV is the type used in the onion to refenernce the CLTV + // LockTimeTLV is the type used in the onion to reference the CLTV // value that should be used for the next hop's HTLC. LockTimeOnionType tlv.Type = 4 diff --git a/routing/chainview/bitcoind.go b/routing/chainview/bitcoind.go index 9a298edd4..c38c4df8f 100644 --- a/routing/chainview/bitcoind.go +++ b/routing/chainview/bitcoind.go @@ -231,7 +231,7 @@ func (b *BitcoindFilteredChainView) FilterBlock(blockHash *chainhash.Hash) (*Fil // chainFilterer is the primary goroutine which: listens for new blocks coming // and dispatches the relevant FilteredBlock notifications, updates the filter -// due to requests by callers, and finally is able to preform targeted block +// due to requests by callers, and finally is able to perform targeted block // filtration. // // TODO(roasbeef): change to use loadfilter RPC's diff --git a/routing/control_tower.go b/routing/control_tower.go index 950b16f31..19b5ab504 100644 --- a/routing/control_tower.go +++ b/routing/control_tower.go @@ -15,7 +15,7 @@ import ( // restarts. Payments are transitioned through various payment states, and the // ControlTower interface provides access to driving the state transitions. type ControlTower interface { - // This method checks that no suceeded payment exist for this payment + // This method checks that no succeeded payment exist for this payment // hash. InitPayment(lntypes.Hash, *channeldb.PaymentCreationInfo) error @@ -117,7 +117,7 @@ func NewControlTower(db *channeldb.PaymentControl) ControlTower { // InitPayment checks or records the given PaymentCreationInfo with the DB, // making sure it does not already exist as an in-flight payment. Then this -// method returns successfully, the payment is guranteeed to be in the InFlight +// method returns successfully, the payment is guaranteed to be in the InFlight // state. func (p *controlTower) InitPayment(paymentHash lntypes.Hash, info *channeldb.PaymentCreationInfo) error { @@ -258,7 +258,7 @@ func (p *controlTower) SubscribePayment(paymentHash lntypes.Hash) ( // notifySubscribers sends a final payment event to all subscribers of this // payment. The channel will be closed after this. Note that this function must // be executed atomically (by means of a lock) with the database update to -// guarantuee consistency of the notifications. +// guarantee consistency of the notifications. func (p *controlTower) notifySubscribers(paymentHash lntypes.Hash, event *channeldb.MPPayment) { diff --git a/routing/errors.go b/routing/errors.go index 2511757bc..95ed613ca 100644 --- a/routing/errors.go +++ b/routing/errors.go @@ -25,7 +25,7 @@ const ( // funding transaction described by the short channel ID on chain. ErrNoFundingTransaction - // ErrInvalidFundingOutput is returned if the channle funding output + // ErrInvalidFundingOutput is returned if the channel funding output // fails validation. ErrInvalidFundingOutput diff --git a/routing/missioncontrol.go b/routing/missioncontrol.go index 82f1717e2..2bce890d5 100644 --- a/routing/missioncontrol.go +++ b/routing/missioncontrol.go @@ -45,7 +45,7 @@ const ( // DefaultMaxMcHistory is the default maximum history size. DefaultMaxMcHistory = 1000 - // DefaultMcFlushInterval is the defaul inteval we use to flush MC state + // DefaultMcFlushInterval is the default interval we use to flush MC state // to the database. DefaultMcFlushInterval = time.Second diff --git a/routing/missioncontrol_state.go b/routing/missioncontrol_state.go index 3f91939aa..7d6633f2b 100644 --- a/routing/missioncontrol_state.go +++ b/routing/missioncontrol_state.go @@ -91,7 +91,7 @@ func (m *missionControlState) setLastPairResult(fromNode, toNode route.Vertex, } else { // For failures we always want to update both the amount and the // time. Those need to relate to the same result, because the - // time is used to gradually diminish the penality for that + // time is used to gradually diminish the penalty for that // specific result. Updating the timestamp but not the amount // could cause a failure for a lower amount (a more severe // condition) to be revived as if it just happened. diff --git a/routing/pathfind_test.go b/routing/pathfind_test.go index ffb927c8d..926813bcb 100644 --- a/routing/pathfind_test.go +++ b/routing/pathfind_test.go @@ -2861,7 +2861,7 @@ func runEqualCostRouteSelection(t *testing.T, useCache bool) { // Set up a test graph with two possible paths to the target: via a and // via b. The routing fees and probabilities are chosen such that the // algorithm will first explore target->a->source (backwards search). - // This route has fee 6 and a penality of 4 for the 25% success + // This route has fee 6 and a penalty of 4 for the 25% success // probability. The algorithm will then proceed with evaluating // target->b->source, which has a fee of 8 and a penalty of 2 for the // 50% success probability. Both routes have the same path finding cost diff --git a/routing/payment_lifecycle.go b/routing/payment_lifecycle.go index 945a53466..b38fc1aa4 100644 --- a/routing/payment_lifecycle.go +++ b/routing/payment_lifecycle.go @@ -669,9 +669,9 @@ func (p *shardHandler) createNewPaymentAttempt(rt *route.Route, lastShard bool) return lnwire.ShortChannelID{}, nil, nil, err } - // Requesst a new shard from the ShardTracker. If this is an AMP + // Request a new shard from the ShardTracker. If this is an AMP // payment, and this is the last shard, the outstanding shards together - // with ths one will be enough for the receiver to derive all HTLC + // with this one will be enough for the receiver to derive all HTLC // preimages. If this a non-AMP payment, the ShardTracker will return a // simple shard with the payment's static payment hash. shard, err := p.shardTracker.NewShard(attemptID, lastShard) diff --git a/routing/payment_lifecycle_test.go b/routing/payment_lifecycle_test.go index df8cbe4a0..dd729faa2 100644 --- a/routing/payment_lifecycle_test.go +++ b/routing/payment_lifecycle_test.go @@ -352,7 +352,7 @@ func TestRouterPaymentStateMachine(t *testing.T) { }, { // Tests that the router is able to handle the - // receieved payment result after a restart. + // received payment result after a restart. name: "single shot restart", steps: []string{ @@ -453,7 +453,7 @@ func testPaymentLifecycle(t *testing.T, test paymentLifecycleTestCase, chainView := newMockChainView(chain) // We set uo the use the following channels and a mock Payer to - // synchonize with the interaction to the Switch. + // synchronize with the interaction to the Switch. sendResult := make(chan error) paymentResult := make(chan *htlcswitch.PaymentResult) @@ -688,7 +688,7 @@ func testPaymentLifecycle(t *testing.T, test paymentLifecycleTestCase, // In this state we expect the router to call the // GetPaymentResult method, and we will respond with a - // terminal error, indiating the router should stop + // terminal error, indicating the router should stop // making payment attempts. case getPaymentResultTerminalFailure: failure := htlcswitch.NewForwardingError( diff --git a/routing/result_interpretation.go b/routing/result_interpretation.go index 19c43e4a1..8c8829420 100644 --- a/routing/result_interpretation.go +++ b/routing/result_interpretation.go @@ -190,7 +190,7 @@ func (i *interpretedResult) processPaymentOutcomeFinal( // from its predecessor. i.failPair(route, n-1) - // The other hops relayed corectly, so assign those pairs a + // The other hops relayed correctly, so assign those pairs a // success result. At this point, n >= 2. i.successPairRange(route, 0, n-2) diff --git a/routing/router.go b/routing/router.go index c0578c564..7da746222 100644 --- a/routing/router.go +++ b/routing/router.go @@ -195,7 +195,7 @@ type PaymentAttemptDispatcher interface { } // PaymentSessionSource is an interface that defines a source for the router to -// retrive new payment sessions. +// retrieve new payment sessions. type PaymentSessionSource interface { // NewPaymentSession creates a new payment session that will produce // routes to the given target. An optional set of routing hints can be @@ -2579,7 +2579,7 @@ func (r *ChannelRouter) IsKnownEdge(chanID lnwire.ShortChannelID) bool { return exists || isZombie } -// IsStaleEdgePolicy returns true if the graph soruce has a channel edge for +// IsStaleEdgePolicy returns true if the graph source has a channel edge for // the passed channel ID (and flags) that have a more recent timestamp. // // NOTE: This method is part of the ChannelGraphSource interface. diff --git a/routing/router_test.go b/routing/router_test.go index 34bfcac05..4a3b5bcee 100644 --- a/routing/router_test.go +++ b/routing/router_test.go @@ -858,7 +858,7 @@ func TestSendPaymentPrivateEdgeUpdateFeeExceedsLimit(t *testing.T) { // TestSendPaymentErrorNonFinalTimeLockErrors tests that if we receive either // an ExpiryTooSoon or a IncorrectCltvExpiry error from a node, then we prune -// that node from the available graph witin a mission control session. This +// that node from the available graph within a mission control session. This // test ensures that we'll route around errors due to nodes not knowing the // current block height. func TestSendPaymentErrorNonFinalTimeLockErrors(t *testing.T) { diff --git a/routing/shards/shard_tracker.go b/routing/shards/shard_tracker.go index a41461eb4..a7c0e9ea2 100644 --- a/routing/shards/shard_tracker.go +++ b/routing/shards/shard_tracker.go @@ -24,7 +24,7 @@ type PaymentShard interface { AMP() *record.AMP } -// ShardTracker is an interfae representing a tracker that keeps track of the +// ShardTracker is an interface representing a tracker that keeps track of the // inflight shards of a payment, and is able to assign new shards the correct // options such as hash and extra records. type ShardTracker interface { @@ -41,11 +41,11 @@ type ShardTracker interface { CancelShard(uint64) error // GetHash retrieves the hash used by the shard of the given attempt - // ID. This wil return an error if the attempt ID is unknown. + // ID. This will return an error if the attempt ID is unknown. GetHash(uint64) (lntypes.Hash, error) } -// Shard is a struct used for simple shards where we obly need to keep map it +// Shard is a struct used for simple shards where we only need to keep map it // to a single hash. type Shard struct { hash lntypes.Hash @@ -82,7 +82,7 @@ type SimpleShardTracker struct { // ShardTracker interface. var _ ShardTracker = (*SimpleShardTracker)(nil) -// NewSimpleShardTracker creates a new intance of the SimpleShardTracker with +// NewSimpleShardTracker creates a new instance of the SimpleShardTracker with // the given payment hash and existing attempts. func NewSimpleShardTracker(paymentHash lntypes.Hash, shards map[uint64]lntypes.Hash) ShardTracker { diff --git a/routing/shards/shard_tracker_test.go b/routing/shards/shard_tracker_test.go index b755e91fc..5515750dc 100644 --- a/routing/shards/shard_tracker_test.go +++ b/routing/shards/shard_tracker_test.go @@ -28,7 +28,7 @@ func TestSimpleShardTracker(t *testing.T) { _, err := tracker.GetHash(0) require.Error(t, err) - // Getting id 1 should workd. + // Getting id 1 should work. hash1, err := tracker.GetHash(1) require.NoError(t, err) diff --git a/routing/validation_barrier.go b/routing/validation_barrier.go index 17d378826..80866acd5 100644 --- a/routing/validation_barrier.go +++ b/routing/validation_barrier.go @@ -28,7 +28,7 @@ type validationSignals struct { // validate the item on the left of the arrow before that on the right. type ValidationBarrier struct { // validationSemaphore is a channel of structs which is used as a - // sempahore. Initially we'll fill this with a buffered channel of the + // semaphore. Initially we'll fill this with a buffered channel of the // size of the number of active requests. Each new job will consume // from this channel, then restore the value upon completion. validationSemaphore chan struct{} @@ -68,7 +68,7 @@ func NewValidationBarrier(numActiveReqs int, quit: quitChan, } - // We'll first initialize a set of sempahores to limit our concurrency + // We'll first initialize a set of semaphores to limit our concurrency // when validating incoming requests in parallel. v.validationSemaphore = make(chan struct{}, numActiveReqs) for i := 0; i < numActiveReqs; i++ { diff --git a/rpcperms/interceptor.go b/rpcperms/interceptor.go index 7be2f0ea0..e20b182ae 100644 --- a/rpcperms/interceptor.go +++ b/rpcperms/interceptor.go @@ -24,7 +24,7 @@ type rpcState uint8 const ( // waitingToStart indicates that we're at the beginning of the startup - // process. In a cluster evironment this may mean that we're waiting to + // process. In a cluster environment this may mean that we're waiting to // become the leader in which case RPC calls will be disabled until // this instance has been elected as leader. waitingToStart rpcState = iota @@ -40,7 +40,7 @@ const ( walletLocked // walletUnlocked means that the wallet has been unlocked, but the full - // RPC server is not yeat ready. + // RPC server is not yet ready. walletUnlocked // rpcActive means that the RPC server is ready to accept calls. @@ -51,7 +51,7 @@ const ( ) var ( - // ErrWaitingToStart is returned if LND is still wating to start, + // ErrWaitingToStart is returned if LND is still waiting to start, // possibly blocked until elected as the leader. ErrWaitingToStart = fmt.Errorf("waiting to start, RPC services not " + "available") diff --git a/rpcserver.go b/rpcserver.go index 6e8f7ad42..aba3a2a81 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -5795,7 +5795,7 @@ func (r *rpcServer) GetNodeInfo(ctx context.Context, // QueryRoutes attempts to query the daemons' Channel Router for a possible // route to a target destination capable of carrying a specific amount of -// satoshis within the route's flow. The retuned route contains the full +// satoshis within the route's flow. The returned route contains the full // details required to craft and send an HTLC, also including the necessary // information that should be present within the Sphinx packet encapsulated // within the HTLC. diff --git a/sample-lnd.conf b/sample-lnd.conf index 295d64c60..42e08dfcf 100644 --- a/sample-lnd.conf +++ b/sample-lnd.conf @@ -77,7 +77,7 @@ ; another IP address to listen on, for example an IPv6 address. ; letsencryptlisten=localhost:8080 -; Request a Let's Encrypt certificate for this domain. Note that the certicate +; Request a Let's Encrypt certificate for this domain. Note that the certificate ; is only requested and stored when the first rpc connection comes in. ; letsencryptdomain=example.com @@ -306,7 +306,7 @@ ; default-remote-max-htlcs=483 ; The duration that a peer connection must be stable before attempting to send a -; channel update to reenable or cancel a pending disables of the peer's channels +; channel update to re-enable or cancel a pending disables of the peer's channels ; on the network. (default: 19m0s) ; chan-enable-timeout=22m diff --git a/server.go b/server.go index ac18a5ae5..e401e1705 100644 --- a/server.go +++ b/server.go @@ -4354,8 +4354,8 @@ func newSweepPkScriptGen( } // shouldPeerBootstrap returns true if we should attempt to perform peer -// boostrapping to actively seek our peers using the set of active network -// bootsrappers. +// bootstrapping to actively seek our peers using the set of active network +// bootstrappers. func shouldPeerBootstrap(cfg *Config) bool { isSimnet := (cfg.Bitcoin.SimNet || cfg.Litecoin.SimNet) isSignet := (cfg.Bitcoin.SigNet || cfg.Litecoin.SigNet) diff --git a/server_test.go b/server_test.go index 48b2f652d..4ac7adec7 100644 --- a/server_test.go +++ b/server_test.go @@ -246,7 +246,7 @@ func TestShouldPeerBootstrap(t *testing.T) { }, }, - // Mainnet active, but boostrap disabled, no boostrap. + // Mainnet active, but bootstrap disabled, no bootstrap. { cfg: &Config{ Bitcoin: &lncfg.Chain{ @@ -257,7 +257,7 @@ func TestShouldPeerBootstrap(t *testing.T) { }, }, - // Mainnet active, should boostrap. + // Mainnet active, should bootstrap. { cfg: &Config{ Bitcoin: &lncfg.Chain{ @@ -268,7 +268,7 @@ func TestShouldPeerBootstrap(t *testing.T) { shouldBoostrap: true, }, - // Testnet active, should boostrap. + // Testnet active, should bootstrap. { cfg: &Config{ Bitcoin: &lncfg.Chain{ diff --git a/sweep/sweeper.go b/sweep/sweeper.go index 80feb9483..f60c0283c 100644 --- a/sweep/sweeper.go +++ b/sweep/sweeper.go @@ -992,7 +992,7 @@ func zipClusters(as, bs []inputCluster) []inputCluster { // Increment j for the next round. j++ - // We did not merge, meaning all the remining clusters from bs + // We did not merge, meaning all the remaining clusters from bs // have lower fee rate. Instead we add a directly to the final // clusters. default: diff --git a/tlv/tlv_test.go b/tlv/tlv_test.go index e5d473413..721c549a1 100644 --- a/tlv/tlv_test.go +++ b/tlv/tlv_test.go @@ -528,7 +528,7 @@ func TestTLVDecodingSuccess(t *testing.T) { err = n2.Decode(r) if err != nil { - t.Fatalf("expected N2 decoding succes, got: %v", + t.Fatalf("expected N2 decoding success, got: %v", err) } }) diff --git a/tor/controller.go b/tor/controller.go index ad9262578..c69a568d0 100644 --- a/tor/controller.go +++ b/tor/controller.go @@ -582,7 +582,7 @@ func computeHMAC256(key, message []byte) []byte { } // supportsV3 is a helper function that parses the current version of the Tor -// server and determines whether it supports creationg v3 onion services through +// server and determines whether it supports creating v3 onion services through // Tor's control port. The version string should be of the format: // major.minor.revision.build func supportsV3(version string) error { diff --git a/tor/controller_test.go b/tor/controller_test.go index 8fab16e38..d2dd91103 100644 --- a/tor/controller_test.go +++ b/tor/controller_test.go @@ -99,7 +99,7 @@ type testProxy struct { // cleanUp is used after each test to properly close the ports/connections. func (tp *testProxy) cleanUp() { - // Don't bother cleanning if there's no a server created. + // Don't bother cleaning if there's no a server created. if tp.server == nil { return } @@ -148,7 +148,7 @@ func createTestProxy(t *testing.T) *testProxy { return tc } -// TestReadResponse contructs a series of possible responses returned by Tor +// TestReadResponse constructs a series of possible responses returned by Tor // and asserts the readResponse can handle them correctly. func TestReadResponse(t *testing.T) { // Create mock server and client connection. diff --git a/watchtower/lookout/lookout.go b/watchtower/lookout/lookout.go index 1d9f911b3..22966ae93 100644 --- a/watchtower/lookout/lookout.go +++ b/watchtower/lookout/lookout.go @@ -192,7 +192,7 @@ func (l *Lookout) processEpoch(epoch *chainntnfs.BlockEpoch, // For each match, use our index to retrieve the original transaction, // which corresponds to the breaching commitment transaction. If the - // decryption succeeds, we will accumlate the assembled justice + // decryption succeeds, we will accumulate the assembled justice // descriptors in a single slice var successes []*JusticeDescriptor for _, match := range matches { diff --git a/watchtower/wtclient/backup_task.go b/watchtower/wtclient/backup_task.go index adc000a84..236e24583 100644 --- a/watchtower/wtclient/backup_task.go +++ b/watchtower/wtclient/backup_task.go @@ -316,7 +316,7 @@ func (t *backupTask) craftSessionPayload( witness := inputScript.Witness rawSignature := witness[0][:len(witness[0])-1] - // Reencode the DER signature into a fixed-size 64 byte + // Re-encode the DER signature into a fixed-size 64 byte // signature. signature, err := lnwire.NewSigFromRawSignature(rawSignature) if err != nil { diff --git a/watchtower/wtclient/session_negotiator.go b/watchtower/wtclient/session_negotiator.go index efddfa990..9ccaf5b79 100644 --- a/watchtower/wtclient/session_negotiator.go +++ b/watchtower/wtclient/session_negotiator.go @@ -118,9 +118,9 @@ var _ SessionNegotiator = (*sessionNegotiator)(nil) // newSessionNegotiator initializes a fresh sessionNegotiator instance. func newSessionNegotiator(cfg *NegotiatorConfig) *sessionNegotiator { - // Generate the set of features the negitator will present to the tower + // Generate the set of features the negotiator will present to the tower // upon connection. For anchor channels, we'll conditionally signal that - // we require support for anchor channels depdening on the requested + // we require support for anchor channels depending on the requested // policy. features := []lnwire.FeatureBit{ wtwire.AltruistSessionsRequired, diff --git a/watchtower/wtdb/client_db.go b/watchtower/wtdb/client_db.go index 4d4f1b5b8..88bf93cb8 100644 --- a/watchtower/wtdb/client_db.go +++ b/watchtower/wtdb/client_db.go @@ -615,7 +615,7 @@ func (c *ClientDB) CreateClientSession(session *ClientSession) error { }, func() {}) } -// createSessionKeyIndexKey returns the indentifier used in the +// createSessionKeyIndexKey returns the identifier used in the // session-key-index index, created as tower-id||blob-type. // // NOTE: The original serialization only used tower-id, which prevents diff --git a/watchtower/wtdb/client_db_test.go b/watchtower/wtdb/client_db_test.go index 0f9235c4d..9d47ab9e7 100644 --- a/watchtower/wtdb/client_db_test.go +++ b/watchtower/wtdb/client_db_test.go @@ -749,7 +749,7 @@ func checkCommittedUpdates(t *testing.T, session *wtdb.ClientSession, } } -// checkAckedUpdates asserts that the AckedUpdates on a sessio match the +// checkAckedUpdates asserts that the AckedUpdates on a session match the // expUpdates provided. func checkAckedUpdates(t *testing.T, session *wtdb.ClientSession, expUpdates map[uint16]wtdb.BackupID) { diff --git a/watchtower/wtdb/session_info.go b/watchtower/wtdb/session_info.go index 2c8809a94..8361cdf75 100644 --- a/watchtower/wtdb/session_info.go +++ b/watchtower/wtdb/session_info.go @@ -72,7 +72,7 @@ func (s *SessionInfo) Encode(w io.Writer) error { ) } -// Decode deserializes the session infor from the given io.Reader. +// Decode deserializes the session info from the given io.Reader. func (s *SessionInfo) Decode(r io.Reader) error { return ReadElements(r, &s.ID, diff --git a/watchtower/wtdb/tower.go b/watchtower/wtdb/tower.go index 1924d9d56..048b50147 100644 --- a/watchtower/wtdb/tower.go +++ b/watchtower/wtdb/tower.go @@ -46,7 +46,7 @@ type Tower struct { // AddAddress adds the given address to the tower's in-memory list of addresses. // If the address's string is already present, the Tower will be left -// unmodified. Otherwise, the adddress is prepended to the beginning of the +// unmodified. Otherwise, the address is prepended to the beginning of the // Tower's addresses, on the assumption that it is fresher than the others. // // NOTE: This method is NOT safe for concurrent use. diff --git a/watchtower/wtdb/tower_db_test.go b/watchtower/wtdb/tower_db_test.go index 413f7c43b..62e19e018 100644 --- a/watchtower/wtdb/tower_db_test.go +++ b/watchtower/wtdb/tower_db_test.go @@ -420,7 +420,7 @@ func runStateUpdateTest(test stateUpdateTest) func(*towerDBHarness) { continue } - // Don't perform the following checks and modfications + // Don't perform the following checks and modifications // if we don't have an expected session to compare // against. if expSession == nil { diff --git a/zpay32/invoice.go b/zpay32/invoice.go index 7f2d86c7a..e8f15a5ee 100644 --- a/zpay32/invoice.go +++ b/zpay32/invoice.go @@ -266,7 +266,7 @@ func Features(features *lnwire.FeatureVector) func(*Invoice) { } // PaymentAddr is a functional option that allows callers of NewInvoice to set -// the desired payment address tht is advertised on the invoice. +// the desired payment address that is advertised on the invoice. func PaymentAddr(addr [32]byte) func(*Invoice) { return func(i *Invoice) { i.PaymentAddr = &addr