From ac24b12bf2f5011ed24fc39f1024ec1881c08d24 Mon Sep 17 00:00:00 2001 From: maurycy Date: Thu, 6 Sep 2018 10:48:46 +0200 Subject: [PATCH] multi: fix various typos in comments --- breacharbiter.go | 2 +- chainntnfs/bitcoindnotify/bitcoind.go | 2 +- chainntnfs/btcdnotify/btcd.go | 2 +- chainntnfs/txconfnotifier.go | 2 +- channeldb/db.go | 2 +- channeldb/graph_test.go | 2 +- contractcourt/channel_arbitrator.go | 6 +++--- discovery/syncer_test.go | 2 +- docs/debugging_lnd.md | 2 +- fundingmanager_test.go | 2 +- htlcswitch/circuit.go | 2 +- htlcswitch/link_test.go | 4 ++-- lnd_test.go | 12 ++++++------ lnrpc/rpc.pb.go | 2 +- lnrpc/rpc.proto | 2 +- lnrpc/rpc.swagger.json | 2 +- lntest/harness.go | 2 +- lnwallet/channel.go | 2 +- lnwallet/interface_test.go | 2 +- routing/pathfind.go | 4 ++-- routing/router_test.go | 2 +- server.go | 8 ++++---- tor/controller.go | 4 ++-- tor/tor.go | 2 +- 24 files changed, 37 insertions(+), 37 deletions(-) diff --git a/breacharbiter.go b/breacharbiter.go index a5ea1a5f..07fb5b25 100644 --- a/breacharbiter.go +++ b/breacharbiter.go @@ -419,7 +419,7 @@ func (b *breachArbiter) waitForSpendEvent(breachInfo *retributionInfo, // We'll wait for any of the outputs to be spent, or that we are // signalled to exit. select { - // A goroutine have signalled that a spend occured. + // A goroutine have signalled that a spend occurred. case <-anySpend: // Signal for the remaining goroutines to exit. close(exit) diff --git a/chainntnfs/bitcoindnotify/bitcoind.go b/chainntnfs/bitcoindnotify/bitcoind.go index 82abfd98..66eb1888 100644 --- a/chainntnfs/bitcoindnotify/bitcoind.go +++ b/chainntnfs/bitcoindnotify/bitcoind.go @@ -497,7 +497,7 @@ func (b *BitcoindNotifier) confDetailsFromTxIndex(txid *chainhash.Hash, // then we may be able to dispatch it immediately. tx, err := b.chainConn.GetRawTransactionVerbose(txid) if err != nil { - // If the transaction lookup was succesful, but it wasn't found + // If the transaction lookup was successful, but it wasn't found // within the index itself, then we can exit early. We'll also // need to look at the error message returned as the error code // is used for multiple errors. diff --git a/chainntnfs/btcdnotify/btcd.go b/chainntnfs/btcdnotify/btcd.go index 157c6c73..8498d368 100644 --- a/chainntnfs/btcdnotify/btcd.go +++ b/chainntnfs/btcdnotify/btcd.go @@ -566,7 +566,7 @@ func (b *BtcdNotifier) confDetailsFromTxIndex(txid *chainhash.Hash, // then we may be able to dispatch it immediately. tx, err := b.chainConn.GetRawTransactionVerbose(txid) if err != nil { - // If the transaction lookup was succesful, but it wasn't found + // If the transaction lookup was successful, but it wasn't found // within the index itself, then we can exit early. We'll also // need to look at the error message returned as the error code // is used for multiple errors. diff --git a/chainntnfs/txconfnotifier.go b/chainntnfs/txconfnotifier.go index ff97b23e..14f150c4 100644 --- a/chainntnfs/txconfnotifier.go +++ b/chainntnfs/txconfnotifier.go @@ -211,7 +211,7 @@ func (tcn *TxConfNotifier) UpdateConfDetails(txid chainhash.Hash, ntfn.details = details // Now, we'll examine whether the transaction of this notification - // request has reched its required number of confirmations. If it has, + // request has reached its required number of confirmations. If it has, // we'll disaptch a confirmation notification to the caller. confHeight := details.BlockHeight + ntfn.NumConfirmations - 1 if confHeight <= tcn.currentHeight { diff --git a/channeldb/db.go b/channeldb/db.go index df611326..612ddbac 100644 --- a/channeldb/db.go +++ b/channeldb/db.go @@ -416,7 +416,7 @@ func (d *DB) FetchWaitingCloseChannels() ([]*OpenChannel, error) { // fetchChannels attempts to retrieve channels currently stored in the // database. The pending parameter determines whether only pending channels // will be returned, or only open channels will be returned. The waitingClose -// parameter determines wheter only channels waiting for a closing transaction +// parameter determines whether only channels waiting for a closing transaction // to be confirmed should be returned. If no active channels exist within the // network, then ErrNoActiveChannels is returned. func fetchChannels(d *DB, pending, waitingClose bool) ([]*OpenChannel, error) { diff --git a/channeldb/graph_test.go b/channeldb/graph_test.go index ab2aa8b1..eb6db864 100644 --- a/channeldb/graph_test.go +++ b/channeldb/graph_test.go @@ -1549,7 +1549,7 @@ func TestNodeUpdatesInHorizon(t *testing.T) { len(nodeUpdates)) } - // We'll create 10 node announcements, each with an update timestmap 10 + // We'll create 10 node announcements, each with an update timestamp 10 // seconds after the other. const numNodes = 10 nodeAnns := make([]LightningNode, 0, numNodes) diff --git a/contractcourt/channel_arbitrator.go b/contractcourt/channel_arbitrator.go index 55a6e238..f2f15a77 100644 --- a/contractcourt/channel_arbitrator.go +++ b/contractcourt/channel_arbitrator.go @@ -264,7 +264,7 @@ func (c *ChannelArbitrator) Start() error { // If the channel has been marked pending close in the database, and we // haven't transitioned the state machine to StateContractClosed (or a - // suceeding state), then a state transition most likely failed. We'll + // succeeding state), then a state transition most likely failed. We'll // try to recover from this by manually advancing the state by setting // the corresponding close trigger. trigger := chainTrigger @@ -1530,7 +1530,7 @@ func (c *ChannelArbitrator) channelAttendant(bestHeight int32) { // logged, we can safely close the channel. After this // succeeds we won't be getting chain events anymore, // so we must make sure we can recover on restart after - // it is marked closed. If the next state transation + // it is marked closed. If the next state transition // fails, we'll start up in the prior state again, and // we won't be longer getting chain events. In this // case we must manually re-trigger the state @@ -1593,7 +1593,7 @@ func (c *ChannelArbitrator) channelAttendant(bestHeight int32) { // logged, we can safely close the channel. After this // succeeds we won't be getting chain events anymore, // so we must make sure we can recover on restart after - // it is marked closed. If the next state transation + // it is marked closed. If the next state transition // fails, we'll start up in the prior state again, and // we won't be longer getting chain events. In this // case we must manually re-trigger the state diff --git a/discovery/syncer_test.go b/discovery/syncer_test.go index 2ae8435b..2a25cea0 100644 --- a/discovery/syncer_test.go +++ b/discovery/syncer_test.go @@ -202,7 +202,7 @@ func TestGossipSyncerFilterGossipMsgsAllInMemory(t *testing.T) { // through the gossiper to the target peer. Our message will consist of // one node announcement above the horizon, one below. Additionally, // we'll include a chan ann with an update below the horizon, one - // with an update timestmap above the horizon, and one without any + // with an update timestamp above the horizon, and one without any // channel updates at all. msgs := []msgWithSenders{ { diff --git a/docs/debugging_lnd.md b/docs/debugging_lnd.md index 3790b81e..44a07d92 100644 --- a/docs/debugging_lnd.md +++ b/docs/debugging_lnd.md @@ -30,7 +30,7 @@ $ lnd --debuglevel==,=,... `lnd` has a built-in feature which allows you to capture profiling data at runtime using [pprof](https://golang.org/pkg/runtime/pprof/), a profiler for Go. The profiler has negligible performance overhead during normal operations -(unless you have explictly enabled CPU profiling). +(unless you have explicitly enabled CPU profiling). To enable this ability, start `lnd` with the `--profile` option using a free port. diff --git a/fundingmanager_test.go b/fundingmanager_test.go index 752f3b53..bc1f7750 100644 --- a/fundingmanager_test.go +++ b/fundingmanager_test.go @@ -825,7 +825,7 @@ func assertAddedToRouterGraph(t *testing.T, alice, bob *testNode, // confirmed. The last arguments can be set if we expect the nodes to advertise // custom min_htlc values as part of their ChannelUpdate. We expect Alice to // advertise the value required by Bob and vice versa. If they are not set the -// advertised value will be checked againts the other node's default min_htlc +// advertised value will be checked against the other node's default min_htlc // value. func assertChannelAnnouncements(t *testing.T, alice, bob *testNode, customMinHtlc ...lnwire.MilliSatoshi) { diff --git a/htlcswitch/circuit.go b/htlcswitch/circuit.go index 8db22deb..d42a5530 100644 --- a/htlcswitch/circuit.go +++ b/htlcswitch/circuit.go @@ -88,7 +88,7 @@ func newPaymentCircuit(hash *[32]byte, pkt *htlcPacket) *PaymentCircuit { } } -// makePaymentCircuit initalizes a payment circuit on the stack using the +// makePaymentCircuit initializes a payment circuit on the stack using the // payment hash and an in-memory htlc packet. func makePaymentCircuit(hash *[32]byte, pkt *htlcPacket) PaymentCircuit { var addRef channeldb.AddRef diff --git a/htlcswitch/link_test.go b/htlcswitch/link_test.go index f9b72405..9e85f163 100644 --- a/htlcswitch/link_test.go +++ b/htlcswitch/link_test.go @@ -2856,7 +2856,7 @@ func TestChannelLinkTrimCircuitsNoCommit(t *testing.T) { assertLinkBandwidth(t, alice.link, aliceStartingBandwidth) // Now, try to commit the last two payment circuits, which are unused - // thus far. These should succeed without hestiation. + // thus far. These should succeed without hesitation. fwdActions = alice.commitCircuits(circuits[halfHtlcs:]) if len(fwdActions.Adds) != halfHtlcs { t.Fatalf("expected %d packets to be added", halfHtlcs) @@ -4528,7 +4528,7 @@ func TestChannelLinkCleanupSpuriousResponses(t *testing.T) { // We start with he following scenario: Bob sends Alice two HTLCs, and a // commitment dance ensures, leaving two HTLCs that Alice can respond // to. Since Alice is in ExitSettle mode, we will then take over and - // provide targetted fail messages to test the link's ability to cleanup + // provide targeted fail messages to test the link's ability to cleanup // spurious responses. // // Bob Alice diff --git a/lnd_test.go b/lnd_test.go index 24079bf3..b9077dab 100644 --- a/lnd_test.go +++ b/lnd_test.go @@ -4492,7 +4492,7 @@ func testInvoiceRoutingHints(net *lntest.NetworkHarness, t *harnessTest) { timeout := time.Duration(15 * time.Second) const chanAmt = btcutil.Amount(100000) - // Throughout this test, we'll be opening a channel betwen Alice and + // Throughout this test, we'll be opening a channel between Alice and // several other parties. // // First, we'll create a private channel between Alice and Bob. This @@ -9523,7 +9523,7 @@ func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest) assertTxInBlock(t, block, commitHash) // After the force close transacion is mined, Carol should broadcast - // her second level HTLC transacion. Bob will braodcast a sweep tx to + // her second level HTLC transacion. Bob will broadcast a sweep tx to // sweep his output in the channel with Carol. He can do this // immediately, as the output is not timelocked since Carol was the one // force closing. @@ -9851,7 +9851,7 @@ func testMultiHopHtlcRemoteChainClaim(net *lntest.NetworkHarness, t *harnessTest assertTxInBlock(t, block, commitHash) // After the force close transacion is mined, Carol should broadcast - // her second level HTLC transacion. Bob will braodcast a sweep tx to + // her second level HTLC transacion. Bob will broadcast a sweep tx to // sweep his output in the channel with Carol. He can do this // immediately, as the output is not timelocked since Carol was the one // force closing. @@ -11473,7 +11473,7 @@ func testQueryRoutes(net *lntest.NetworkHarness, t *harnessTest) { } // For all hops except the last, we check that fee equals feePerHop - // and amount to foward deducts feePerHop on each hop. + // and amount to forward deducts feePerHop on each hop. expectedAmtToForwardMSat := expectedTotalAmtMSat for j, hop := range route.Hops[:len(route.Hops)-1] { expectedAmtToForwardMSat -= feePerHopMSat @@ -11499,7 +11499,7 @@ func testQueryRoutes(net *lntest.NetworkHarness, t *harnessTest) { i, j, expectedAmtToForwardMSat, hop.AmtToForwardMsat) } } - // Last hop should have zero fee and amount to foward should equal + // Last hop should have zero fee and amount to forward should equal // payment amount. hop := route.Hops[len(route.Hops)-1] @@ -11650,7 +11650,7 @@ func testRouteFeeCutoff(net *lntest.NetworkHarness, t *harnessTest) { } } - // The payments should only be succesful across the route: + // The payments should only be successful across the route: // Alice -> Bob -> Dave // Therefore, we'll update the fee policy on Carol's side for the // channel between her and Dave to invalidate the route: diff --git a/lnrpc/rpc.pb.go b/lnrpc/rpc.pb.go index 11b2f81c..acceb415 100644 --- a/lnrpc/rpc.pb.go +++ b/lnrpc/rpc.pb.go @@ -404,7 +404,7 @@ func (*ChangePasswordResponse) Descriptor() ([]byte, []int) { return fileDescrip type Transaction struct { // / The transaction hash TxHash string `protobuf:"bytes,1,opt,name=tx_hash" json:"tx_hash,omitempty"` - // / The transaction ammount, denominated in satoshis + // / The transaction amount, denominated in satoshis Amount int64 `protobuf:"varint,2,opt,name=amount" json:"amount,omitempty"` // / The number of confirmations NumConfirmations int32 `protobuf:"varint,3,opt,name=num_confirmations" json:"num_confirmations,omitempty"` diff --git a/lnrpc/rpc.proto b/lnrpc/rpc.proto index 9174f456..0ae7c9bd 100644 --- a/lnrpc/rpc.proto +++ b/lnrpc/rpc.proto @@ -636,7 +636,7 @@ message Transaction { /// The transaction hash string tx_hash = 1 [ json_name = "tx_hash" ]; - /// The transaction ammount, denominated in satoshis + /// The transaction amount, denominated in satoshis int64 amount = 2 [ json_name = "amount" ]; /// The number of confirmations diff --git a/lnrpc/rpc.swagger.json b/lnrpc/rpc.swagger.json index bbcad7d3..9fd85551 100644 --- a/lnrpc/rpc.swagger.json +++ b/lnrpc/rpc.swagger.json @@ -2672,7 +2672,7 @@ "amount": { "type": "string", "format": "int64", - "title": "/ The transaction ammount, denominated in satoshis" + "title": "/ The transaction amount, denominated in satoshis" }, "num_confirmations": { "type": "integer", diff --git a/lntest/harness.go b/lntest/harness.go index 681fa128..8a90cbbf 100644 --- a/lntest/harness.go +++ b/lntest/harness.go @@ -705,7 +705,7 @@ type OpenChannelParams struct { // unconfirmed outputs to fund the channel. SpendUnconfirmed bool - // MinHtlc is the htlc_minumum_msat value set when opening the channel. + // MinHtlc is the htlc_minimum_msat value set when opening the channel. MinHtlc lnwire.MilliSatoshi } diff --git a/lnwallet/channel.go b/lnwallet/channel.go index bad130b1..2970c33c 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -3354,7 +3354,7 @@ func (lc *LightningChannel) ProcessChanSyncMsg( // We owe them a commitment if the tip of their chain (from our Pov) is // equal to what they think their next commit height should be. We'll - // re-send all the updates neccessary to recreate this state, along + // re-send all the updates necessary to recreate this state, along // with the commit sig. case msg.NextLocalCommitHeight == remoteTipHeight: walletLog.Debugf("ChannelPoint(%v), sync: remote's next "+ diff --git a/lnwallet/interface_test.go b/lnwallet/interface_test.go index eb2be23e..57077f3d 100644 --- a/lnwallet/interface_test.go +++ b/lnwallet/interface_test.go @@ -1200,7 +1200,7 @@ func testTransactionSubscriptions(miner *rpctest.Harness, select { case <-time.After(time.Second * 10): t.Fatalf("transactions not received after 10 seconds") - case <-unconfirmedNtfns: // Fall through on successs + case <-unconfirmedNtfns: // Fall through on success } } diff --git a/routing/pathfind.go b/routing/pathfind.go index 72bd9de0..3c3219d2 100644 --- a/routing/pathfind.go +++ b/routing/pathfind.go @@ -493,7 +493,7 @@ func findPath(tx *bolt.Tx, graph *channeldb.ChannelGraph, // For each node in the graph, we create an entry in the distance map // for the node set with a distance of "infinity". graph.ForEachNode // also returns the source node, so there is no need to add the source - // node explictly. + // node explicitly. distance := make(map[Vertex]nodeWithDist) if err := graph.ForEachNode(tx, func(_ *bolt.Tx, node *channeldb.LightningNode) error { // TODO(roasbeef): with larger graph can just use disk seeks @@ -597,7 +597,7 @@ func findPath(tx *bolt.Tx, graph *channeldb.ChannelGraph, // Compute fee that fromNode is charging. It is based on the // amount that needs to be sent to the next node in the route. // - // Source node has no precedessor to pay a fee. Therefore set + // Source node has no predecessor to pay a fee. Therefore set // fee to zero, because it should not be included in the fee // limit check and edge weight. // diff --git a/routing/router_test.go b/routing/router_test.go index 0c9492be..9008cabf 100644 --- a/routing/router_test.go +++ b/routing/router_test.go @@ -537,7 +537,7 @@ func TestSendPaymentErrorNonFinalTimeLockErrors(t *testing.T) { } // Send off the payment request to the router, this payment should - // suceed as we should actually go through Pham Nuwen in order to get + // succeed as we should actually go through Pham Nuwen in order to get // to Sophon, even though he has higher fees. paymentPreImage, route, err := ctx.router.SendPayment(&payment) if err != nil { diff --git a/server.go b/server.go index 816a1b5d..2fe9434f 100644 --- a/server.go +++ b/server.go @@ -1053,7 +1053,7 @@ func (s *server) Stopped() bool { return atomic.LoadInt32(&s.shutdown) != 0 } -// configurePortForwarding attempts to set up port forwarding for the diffrent +// configurePortForwarding attempts to set up port forwarding for the different // ports that the server will be listening on. // // NOTE: This should only be used when using some kind of NAT traversal to @@ -1094,7 +1094,7 @@ func (s *server) removePortForwarding() { } } -// watchExternalIP continously checks for an updated external IP address every +// watchExternalIP continuously checks for an updated external IP address every // 15 minutes. Once a new IP address has been detected, it will automatically // handle port forwarding rules and send updated node announcements to the // currently connected peers. @@ -1165,7 +1165,7 @@ out: } // Now, we'll need to update the addresses in our node's - // announcement in order to propogate the update + // announcement in order to propagate the update // throughout the network. We'll only include addresses // that have a different IP from the previous one, as // the previous IP is no longer valid. @@ -2326,7 +2326,7 @@ func (s *server) peerInitializer(p *peer) { s.wg.Add(1) go s.peerTerminationWatcher(p, ready) - // Start teh peer! If an error occurs, we Disconnect the peer, which + // Start the peer! If an error occurs, we Disconnect the peer, which // will unblock the peerTerminationWatcher. if err := p.Start(); err != nil { p.Disconnect(fmt.Errorf("unable to start peer: %v", err)) diff --git a/tor/controller.go b/tor/controller.go index 6a369ff8..0d9ef267 100644 --- a/tor/controller.go +++ b/tor/controller.go @@ -124,8 +124,8 @@ func (c *Controller) sendCommand(command string) (int, string, error) { return code, reply, nil } -// parseTorReply parses the reply from the Tor server after receving a command -// from a controller. This will parse the relevent reply parameters into a map +// parseTorReply parses the reply from the Tor server after receiving a command +// from a controller. This will parse the relevant reply parameters into a map // of keys and values. func parseTorReply(reply string) map[string]string { params := make(map[string]string) diff --git a/tor/tor.go b/tor/tor.go index aa3b6480..3b5d46a0 100644 --- a/tor/tor.go +++ b/tor/tor.go @@ -233,7 +233,7 @@ func IsOnionHost(host string) bool { // We'll now attempt to decode the host without its suffix, as the // suffix includes invalid characters. This will tell us if the host is - // actually valid if succesful. + // actually valid if successful. host = host[:suffixIndex] if _, err := Base32Encoding.DecodeString(host); err != nil { return false