From adf0d98194b289fe0711f3eb94c68ab4bb6243d3 Mon Sep 17 00:00:00 2001 From: Matt Drollette Date: Sun, 17 Dec 2017 20:40:05 -0600 Subject: [PATCH] multi: fix several typos in godoc comments --- autopilot/interface.go | 2 +- breacharbiter.go | 4 ++-- breacharbiter_test.go | 6 +++--- brontide/noise.go | 2 +- chainntnfs/interface.go | 4 ++-- chainntnfs/neutrinonotify/neutrino.go | 2 +- chainntnfs/txconfnotifier.go | 2 +- channeldb/db.go | 2 +- channeldb/graph.go | 6 +++--- channeldb/payments.go | 2 +- config.go | 4 ++-- discovery/bootstrapper.go | 2 +- htlcswitch/mailbox_test.go | 2 +- lntest/node.go | 2 +- lnwallet/btcwallet/btcwallet.go | 4 ++-- lnwallet/btcwallet/config.go | 4 ++-- lnwallet/channel.go | 12 ++++++------ lnwallet/fee_estimator.go | 2 +- lnwallet/interface.go | 8 ++++---- lnwallet/script_utils.go | 6 +++--- lnwallet/wallet.go | 4 ++-- lnwire/announcement_signatures.go | 4 ++-- lnwire/channel_id.go | 2 +- lnwire/channel_update.go | 4 ++-- lnwire/closing_signed.go | 2 +- lnwire/commit_sig.go | 2 +- lnwire/error.go | 2 +- lnwire/lnwire.go | 2 +- lnwire/update_add_htlc.go | 2 +- peer.go | 10 +++++----- routing/chainview/interface.go | 2 +- routing/notifications.go | 2 +- routing/pathfind.go | 2 +- routing/pathfind_test.go | 2 +- routing/router.go | 14 +++++++------- utxonursery.go | 4 ++-- zpay32/invoice.go | 2 +- 37 files changed, 70 insertions(+), 70 deletions(-) diff --git a/autopilot/interface.go b/autopilot/interface.go index a92b3f58..81378866 100644 --- a/autopilot/interface.go +++ b/autopilot/interface.go @@ -57,7 +57,7 @@ type Channel struct { // ChannelEdge is a struct that holds details concerning a channel, but also // contains a reference to the Node that this channel connects to as a directed -// edge witihn the graph. The existence of this reference to the connected node +// edge within the graph. The existence of this reference to the connected node // will allow callers to traverse the graph in an object-oriented manner. type ChannelEdge struct { // Channel contains the attributes of this channel. diff --git a/breacharbiter.go b/breacharbiter.go index 73f9a15c..a94608a1 100644 --- a/breacharbiter.go +++ b/breacharbiter.go @@ -1091,7 +1091,7 @@ func (b *breachArbiter) createJusticeTx( // craftCommitmentSweepTx creates a transaction to sweep the non-delayed output // within the commitment transaction that pays to us. We must manually sweep // this output as it uses a tweaked public key in its pkScript, so the wallet -// won't immediacy be aware of it. +// won't immediately be aware of it. // // TODO(roasbeef): alternative options // * leave the output in the chain, use as input to future funding tx @@ -1222,7 +1222,7 @@ func (b *breachArbiter) sweepSpendableOutputsTxn(txWeight uint64, type RetributionStore interface { // Add persists the retributionInfo to disk, using the information's // chanPoint as the key. This method should overwrite any existing - // entires found under the same key, and an error should be raised if + // entries found under the same key, and an error should be raised if // the addition fails. Add(retInfo *retributionInfo) error diff --git a/breacharbiter_test.go b/breacharbiter_test.go index cc38cfe6..9cdaadea 100644 --- a/breacharbiter_test.go +++ b/breacharbiter_test.go @@ -678,7 +678,7 @@ func testRetributionStoreAdds( // testing the store under failures, we restart the store and verify // that the contents are the same. for i, retInfo := range retributions { - // Snapshot number of entires before and after the addition. + // Snapshot number of entries before and after the addition. nbefore := countRetributions(t, frs) if err := frs.Add(&retInfo); err != nil { t.Fatalf("unable to add to retribution %v to store: %v", @@ -719,7 +719,7 @@ func testRetributionStoreRemoves( // testing the store under failures, we restart the store and verify // that the contents are the same. for i, retInfo := range retributions { - // Snapshot number of entires before and after the removal. + // Snapshot number of entries before and after the removal. nbefore := countRetributions(t, frs) if err := frs.Remove(&retInfo.chanPoint); err != nil { t.Fatalf("unable to remove to retribution %v "+ @@ -809,7 +809,7 @@ restartCheck: err) } - // Check that retribution store emits nrets entires + // Check that retribution store emits nrets entries if count := countRetributions(t, frs); count != nrets { t.Fatalf("expected %v retributions, found %v", nrets, count) } diff --git a/brontide/noise.go b/brontide/noise.go index ef3f6964..cc3e628e 100644 --- a/brontide/noise.go +++ b/brontide/noise.go @@ -663,7 +663,7 @@ func (b *Machine) split() { } // WriteMessage writes the next message p to the passed io.Writer. The -// ciphertext of the message is pre-pended with an encrypt+auth'd length which +// ciphertext of the message is prepended with an encrypt+auth'd length which // must be used as the AD to the AEAD construction when being decrypted by the // other side. func (b *Machine) WriteMessage(w io.Writer, p []byte) error { diff --git a/chainntnfs/interface.go b/chainntnfs/interface.go index 23a65db9..0b7a1009 100644 --- a/chainntnfs/interface.go +++ b/chainntnfs/interface.go @@ -25,7 +25,7 @@ type ChainNotifier interface { // confirmations has been reached for the txid, as well as if the // original tx gets re-org'd out of the mainchain. The heightHint // parameter is provided as a convenience to light clients. The - // heightHint denotes the earlies height in the blockchain in which the + // heightHint denotes the earliest height in the blockchain in which the // target txid _could_ have been included in the chain. This can be // used to bound the search space when checking to see if a // notification can immediately be dispatched due to historical data. @@ -40,7 +40,7 @@ type ChainNotifier interface { // returned SpendEvent will receive a send on the 'Spend' transaction // once a transaction spending the input is detected on the blockchain. // The heightHint parameter is provided as a convenience to light - // clients. The heightHint denotes the earlies height in the blockchain + // clients. The heightHint denotes the earliest height in the blockchain // in which the target output could've been created. // // NOTE: This notifications should be triggered once the transaction is diff --git a/chainntnfs/neutrinonotify/neutrino.go b/chainntnfs/neutrinonotify/neutrino.go index 28d738e7..27f6129c 100644 --- a/chainntnfs/neutrinonotify/neutrino.go +++ b/chainntnfs/neutrinonotify/neutrino.go @@ -160,7 +160,7 @@ func (n *NeutrinoNotifier) Start() error { return nil } -// Stop shutsdown the NeutrinoNotifier. +// Stop shuts down the NeutrinoNotifier. func (n *NeutrinoNotifier) Stop() error { // Already shutting down? if atomic.AddInt32(&n.stopped, 1) != 1 { diff --git a/chainntnfs/txconfnotifier.go b/chainntnfs/txconfnotifier.go index 414b6b06..6d941553 100644 --- a/chainntnfs/txconfnotifier.go +++ b/chainntnfs/txconfnotifier.go @@ -11,7 +11,7 @@ import ( // once the target transaction gets sufficient confirmations. The client is // asynchronously notified via the ConfirmationEvent channels. type ConfNtfn struct { - // TxID is the hash of the transaction for which confirmatino notifications + // TxID is the hash of the transaction for which confirmation notifications // are requested. TxID *chainhash.Hash diff --git a/channeldb/db.go b/channeldb/db.go index f79dc0aa..74437289 100644 --- a/channeldb/db.go +++ b/channeldb/db.go @@ -392,7 +392,7 @@ func fetchChannels(d *DB, pendingOnly bool) ([]*OpenChannel, error) { // FetchClosedChannels attempts to fetch all closed channels from the database. // The pendingOnly bool toggles if channels that aren't yet fully closed should -// be returned int he response or not. When a channel was cooperatively closed, +// be returned in the response or not. When a channel was cooperatively closed, // it becomes fully closed after a single confirmation. When a channel was // forcibly closed, it will become fully closed after _all_ the pending funds // (if any) have been swept. diff --git a/channeldb/graph.go b/channeldb/graph.go index 788e58b1..945036f8 100644 --- a/channeldb/graph.go +++ b/channeldb/graph.go @@ -344,7 +344,7 @@ func (c *ChannelGraph) SetSourceNode(node *LightningNode) error { // in the database from before, this will add a new, unconnected one to the // graph. If it is present from before, this will update that node's // information. Note that this method is expected to only be called to update -// an already present node from a node annoucement, or to insert a node found +// an already present node from a node announcement, or to insert a node found // in a channel update. // // TODO(roasbeef): also need sig of announcement @@ -939,7 +939,7 @@ func delChannelByEdge(edges *bolt.Bucket, edgeIndex *bolt.Bucket, // the ChannelEdgePolicy determines which of the directed edges are being // updated. If the flag is 1, then the first node's information is being // updated, otherwise it's the second node's information. The node ordering is -// determined tby the lexicographical ordering of the identity public keys of +// determined by the lexicographical ordering of the identity public keys of // the nodes on either side of the channel. func (c *ChannelGraph) UpdateEdgePolicy(edge *ChannelEdgePolicy) error { return c.db.Update(func(tx *bolt.Tx) error { @@ -990,7 +990,7 @@ type LightningNode struct { // used to authenticated any advertisements/updates sent by the node. PubKey *btcec.PublicKey - // HaveNodeAnnouncement indicates whether we received a node annoucement + // HaveNodeAnnouncement indicates whether we received a node announcement // for this particular node. If true, the remaining fields will be set, // if false only the PubKey is known for this node. HaveNodeAnnouncement bool diff --git a/channeldb/payments.go b/channeldb/payments.go index 4192cac8..48839d4b 100644 --- a/channeldb/payments.go +++ b/channeldb/payments.go @@ -32,7 +32,7 @@ type OutgoingPayment struct { // from the second-to-last hop to the destination. TimeLockLength uint32 - // Path encodes the path the payment took throuhg the network. The path + // Path encodes the path the payment took through the network. The path // excludes the outgoing node and consists of the hex-encoded // compressed public key of each of the nodes involved in the payment. Path [][33]byte diff --git a/config.go b/config.go index a3fa7fba..d0751d1c 100644 --- a/config.go +++ b/config.go @@ -63,7 +63,7 @@ var ( type chainConfig struct { Active bool `long:"active" description:"If the chain should be active or not."` - ChainDir string `long:"chaindir" description:"The directory to store the chains's data within."` + ChainDir string `long:"chaindir" description:"The directory to store the chain's data within."` RPCHost string `long:"rpchost" description:"The daemon's rpc listening address. If a port is omitted, then the default port for the selected chain parameters will be used."` RPCUser string `long:"rpcuser" description:"Username for RPC connections"` @@ -415,7 +415,7 @@ func cleanAndExpandPath(path string) string { // the levels accordingly. An appropriate error is returned if anything is // invalid. func parseAndSetDebugLevels(debugLevel string) error { - // When the specified string doesn't have any delimters, treat it as + // When the specified string doesn't have any delimiters, treat it as // the log level for all subsystems. if !strings.Contains(debugLevel, ",") && !strings.Contains(debugLevel, "=") { // Validate debug log level. diff --git a/discovery/bootstrapper.go b/discovery/bootstrapper.go index 7a6d6109..b79a46ee 100644 --- a/discovery/bootstrapper.go +++ b/discovery/bootstrapper.go @@ -233,7 +233,7 @@ func (c *ChannelGraphBootstrapper) Name() string { } // DNSSeedBootstrapper as an implementation of the NetworkPeerBootstrapper -// interface which implements peer bootstrapping via a spcial DNS seed as +// interface which implements peer bootstrapping via a special DNS seed as // defined in BOLT-0010. For further details concerning Lightning's current DNS // boot strapping protocol, see this link: // * https://github.com/lightningnetwork/lightning-rfc/blob/master/10-dns-bootstrap.md diff --git a/htlcswitch/mailbox_test.go b/htlcswitch/mailbox_test.go index a31ff5e8..3e36fd97 100644 --- a/htlcswitch/mailbox_test.go +++ b/htlcswitch/mailbox_test.go @@ -87,7 +87,7 @@ func TestMailBoxCouriers(t *testing.T) { } // Additionally, the set of packets should match exactly, as we should - // have received the packets int he exact same ordering that we added. + // have received the packets in the exact same ordering that we added. if !reflect.DeepEqual(sentPackets, recvdPackets) { t.Fatalf("recvd packets mismatched: expected %v, got %v", spew.Sdump(sentPackets), spew.Sdump(recvdPackets)) diff --git a/lntest/node.go b/lntest/node.go index 9242835c..8f018891 100644 --- a/lntest/node.go +++ b/lntest/node.go @@ -147,7 +147,7 @@ func (cfg nodeConfig) genArgs() []string { } // HarnessNode represents an instance of lnd running within our test network -// harness. Each HarnessNode instance also fully embedds an RPC client in +// harness. Each HarnessNode instance also fully embeds an RPC client in // order to pragmatically drive the node. type HarnessNode struct { cfg *nodeConfig diff --git a/lnwallet/btcwallet/btcwallet.go b/lnwallet/btcwallet/btcwallet.go index a89bc71e..72c783b1 100644 --- a/lnwallet/btcwallet/btcwallet.go +++ b/lnwallet/btcwallet/btcwallet.go @@ -215,7 +215,7 @@ func (b *BtcWallet) NewAddress(t lnwallet.AddressType, change bool) (btcutil.Add return b.wallet.NewAddress(defaultAccount, addrType) } -// GetPrivKey retrives the underlying private key associated with the passed +// GetPrivKey retrieves the underlying private key associated with the passed // address. If the we're unable to locate the proper private key, then a // non-nil error will be returned. // @@ -324,7 +324,7 @@ func (b *BtcWallet) LockOutpoint(o wire.OutPoint) { } // UnlockOutpoint unlocks an previously locked output, marking it eligible for -// coin seleciton. +// coin selection. // // This is a part of the WalletController interface. func (b *BtcWallet) UnlockOutpoint(o wire.OutPoint) { diff --git a/lnwallet/btcwallet/config.go b/lnwallet/btcwallet/config.go index 08eaacae..9d6bd5a5 100644 --- a/lnwallet/btcwallet/config.go +++ b/lnwallet/btcwallet/config.go @@ -39,11 +39,11 @@ var ( walletDbName = "lnwallet.db" ) -// Config is a struct which houses configuration paramters which modify the +// Config is a struct which houses configuration parameters which modify the // instance of BtcWallet generated by the New() function. type Config struct { // DataDir is the name of the directory where the wallet's persistent - // state should be sotred. + // state should be stored. DataDir string // LogDir is the name of the directory which should be used to store diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 8ca79854..d7a78b05 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -166,7 +166,7 @@ type PaymentDescriptor struct { // the preimage to this hash is presented. RHash PaymentHash - // RPreimage is the preimage that settles the HTLC pointed to wthin the + // RPreimage is the preimage that settles the HTLC pointed to within the // log by the ParentIndex. RPreimage PaymentHash @@ -1121,7 +1121,7 @@ type LightningChannel struct { // commitment and cooperative close transactions. feeEstimator FeeEstimator - // Capcity is the total capacity of this channel. + // Capacity is the total capacity of this channel. Capacity btcutil.Amount // stateHintObfuscator is a 48-bit state hint that's used to obfsucate @@ -1400,7 +1400,7 @@ func (lc *LightningChannel) logUpdateToPayDesc(logUpdate *channeldb.LogUpdate, // For offered HTLC's, we'll map that to a PaymentDescriptor with the // type Add, ensuring we restore the necessary fields. From the PoV of - // the commitment chain, this HTLC was included int he remote chain, + // the commitment chain, this HTLC was included in the remote chain, // but not the local chain. case *lnwire.UpdateAddHTLC: // First, we'll map all the relevant fields in the @@ -3234,7 +3234,7 @@ func (lc *LightningChannel) ProcessChanSyncMsg(msg *lnwire.ChannelReestablish) ( // When the remote party receiver this message one of three things may happen: // // 1. We're fully synced and no messages need to be sent. -// 2. We didn't get the lat CommitSig message they sent, to they'll re-send +// 2. We didn't get the last CommitSig message they sent, to they'll re-send // it. // 3. We didn't get the last RevokeAndAck message they sent, so they'll // re-send it. @@ -4250,9 +4250,9 @@ type UnilateralCloseSummary struct { HtlcResolutions []OutgoingHtlcResolution } -// OutgoingHtlcResolution houses the information necessary to sweep any outging +// OutgoingHtlcResolution houses the information necessary to sweep any outgoing // HTLC's after their contract has expired. This struct will be needed in one -// of tow cases: the local party force closes the commitment transaction or the +// of two cases: the local party force closes the commitment transaction or the // remote party unilaterally closes with their version of the commitment // transaction. type OutgoingHtlcResolution struct { diff --git a/lnwallet/fee_estimator.go b/lnwallet/fee_estimator.go index 567b7b6d..a36fa81a 100644 --- a/lnwallet/fee_estimator.go +++ b/lnwallet/fee_estimator.go @@ -75,7 +75,7 @@ var _ FeeEstimator = (*StaticFeeEstimator)(nil) // BtcdFeeEstimator is an implementation of the FeeEstimator interface backed // by the RPC interface of an active btcd node. This implementation will proxy -// any fee estimation requests to btcd's RPC interace. +// any fee estimation requests to btcd's RPC interface. type BtcdFeeEstimator struct { // fallBackFeeRate is the fall back fee rate in satoshis per byte that // is returned if the fee estimator does not yet have enough data to diff --git a/lnwallet/interface.go b/lnwallet/interface.go index efc3a26c..c257d3e6 100644 --- a/lnwallet/interface.go +++ b/lnwallet/interface.go @@ -12,7 +12,7 @@ import ( ) // ErrNotMine is an error denoting that a WalletController instance is unable -// to spend a specifid output. +// to spend a specified output. var ErrNotMine = errors.New("the passed output doesn't belong to the wallet") // AddressType is a enum-like type which denotes the possible address types @@ -132,7 +132,7 @@ type WalletController interface { // p2wkh, p2wsh, etc. NewAddress(addrType AddressType, change bool) (btcutil.Address, error) - // GetPrivKey retrives the underlying private key associated with the + // GetPrivKey retrieves the underlying private key associated with the // passed address. If the wallet is unable to locate this private key // due to the address not being under control of the wallet, then an // error should be returned. @@ -278,13 +278,13 @@ type MessageSigner interface { // string identifier along with a 'New()' method which is responsible for // initializing a particular WalletController concrete implementation. type WalletDriver struct { - // WalletType is a string which uniquely identifes the WalletController + // WalletType is a string which uniquely identifies the WalletController // that this driver, drives. WalletType string // New creates a new instance of a concrete WalletController // implementation given a variadic set up arguments. The function takes - // a varidaic number of interface parameters in order to provide + // a variadic number of interface parameters in order to provide // initialization flexibility, thereby accommodating several potential // WalletController implementations. New func(args ...interface{}) (WalletController, error) diff --git a/lnwallet/script_utils.go b/lnwallet/script_utils.go index 373124b8..4620ae0b 100644 --- a/lnwallet/script_utils.go +++ b/lnwallet/script_utils.go @@ -1171,7 +1171,7 @@ func DeriveRevocationPubkey(revokeBase, commitPoint *btcec.PublicKey) *btcec.Pub // within the commitment transaction of a node in the case that they broadcast // a previously revoked commitment transaction. // -// The private key is derived as follwos: +// The private key is derived as follows: // revokePriv := (revokeBasePriv * sha256(revocationBase || commitPoint)) + // (commitSecret * sha256(commitPoint || revocationBase)) mod N // @@ -1241,7 +1241,7 @@ func DeriveRevocationRoot(derivationRoot *btcec.PrivateKey, // number is encoded using 48 bits. The lower 24 bits of the lock time are the // lower 24 bits of the obfuscated state number and the lower 24 bits of the // sequence field are the higher 24 bits. Finally before encoding, the -// obfuscater is XOR'd against the state number in order to hide the exact +// obfuscator is XOR'd against the state number in order to hide the exact // state number from the PoV of outside parties. func SetStateNumHint(commitTx *wire.MsgTx, stateNum uint64, obfuscator [StateHintSize]byte) error { @@ -1284,7 +1284,7 @@ func SetStateNumHint(commitTx *wire.MsgTx, stateNum uint64, // See setStateNumHint for further details w.r.t exactly how the state-hints // are encoded. func GetStateNumHint(commitTx *wire.MsgTx, obfuscator [StateHintSize]byte) uint64 { - // Convert the obfuscater into a uint64, this will be used to + // Convert the obfuscator into a uint64, this will be used to // de-obfuscate the final recovered state number. var obfs [8]byte copy(obfs[2:], obfuscator[:]) diff --git a/lnwallet/wallet.go b/lnwallet/wallet.go index 446ee6de..819088c9 100644 --- a/lnwallet/wallet.go +++ b/lnwallet/wallet.go @@ -368,7 +368,7 @@ func (l *LightningWallet) LockedOutpoints() []*wire.OutPoint { return outPoints } -// ResetReservations reset the volatile wallet state which trakcs all currently +// ResetReservations reset the volatile wallet state which tracks all currently // active reservations. func (l *LightningWallet) ResetReservations() { l.nextFundingID = 0 @@ -381,7 +381,7 @@ func (l *LightningWallet) ResetReservations() { } // ActiveReservations returns a slice of all the currently active -// (non-cancalled) reservations. +// (non-cancelled) reservations. func (l *LightningWallet) ActiveReservations() []*ChannelReservation { reservations := make([]*ChannelReservation, 0, len(l.fundingLimbo)) for _, reservation := range l.fundingLimbo { diff --git a/lnwire/announcement_signatures.go b/lnwire/announcement_signatures.go index 913ba64c..fabefadd 100644 --- a/lnwire/announcement_signatures.go +++ b/lnwire/announcement_signatures.go @@ -25,12 +25,12 @@ type AnnounceSignatures struct { ShortChannelID ShortChannelID // NodeSignature is the signature which contains the signed announce - // channel message, by this signature we proof that we posses of the + // channel message, by this signature we proof that we possess of the // node pub key and creating the reference node_key -> bitcoin_key. NodeSignature *btcec.Signature // BitcoinSignature is the signature which contains the signed node - // public key, by this signature we proof that we posses of the + // public key, by this signature we proof that we possess of the // bitcoin key and and creating the reverse reference bitcoin_key -> // node_key. BitcoinSignature *btcec.Signature diff --git a/lnwire/channel_id.go b/lnwire/channel_id.go index 62326c9c..827efbaa 100644 --- a/lnwire/channel_id.go +++ b/lnwire/channel_id.go @@ -31,7 +31,7 @@ func (c ChannelID) String() string { } // NewChanIDFromOutPoint converts a target OutPoint into a ChannelID that is -// usable within the network. In order to covert the OutPoint into a ChannelID, +// usable within the network. In order to convert the OutPoint into a ChannelID, // we XOR the lower 2-bytes of the txid within the OutPoint with the big-endian // serialization of the Index of the OutPoint, truncated to 2-bytes. func NewChanIDFromOutPoint(op *wire.OutPoint) ChannelID { diff --git a/lnwire/channel_update.go b/lnwire/channel_update.go index f43f11ef..0243cc68 100644 --- a/lnwire/channel_update.go +++ b/lnwire/channel_update.go @@ -8,7 +8,7 @@ import ( "github.com/roasbeef/btcd/chaincfg/chainhash" ) -// ChanUpdateFlag is a btifield that signals various options concerning a +// ChanUpdateFlag is a bitfield that signals various options concerning a // particular channel edge. Each bit is to be examined in order to determine // how the ChannelUpdate message is to be interpreted. type ChanUpdateFlag uint16 @@ -27,7 +27,7 @@ const ( // ChannelUpdate message is used after channel has been initially announced. // Each side independently announces its fees and minimum expiry for HTLCs and -// other parameters. Also this message is used to redeclare initially setted +// other parameters. Also this message is used to redeclare initially set // channel parameters. type ChannelUpdate struct { // Signature is used to validate the announced data and prove the diff --git a/lnwire/closing_signed.go b/lnwire/closing_signed.go index e1f56dae..087f879b 100644 --- a/lnwire/closing_signed.go +++ b/lnwire/closing_signed.go @@ -15,7 +15,7 @@ import ( // // NOTE: The responder is able to send a signature without any additional // messages as all transactions are assembled observing BIP 69 which defines a -// cannonical ordering for input/outputs. Therefore, both sides are able to +// canonical ordering for input/outputs. Therefore, both sides are able to // arrive at an identical closure transaction as they know the order of the // inputs/outputs. type ClosingSigned struct { diff --git a/lnwire/commit_sig.go b/lnwire/commit_sig.go index 3c538c02..452dc3f3 100644 --- a/lnwire/commit_sig.go +++ b/lnwire/commit_sig.go @@ -23,7 +23,7 @@ type CommitSig struct { // additional data due to the piggybacking of Bob's next revocation // hash in his prior RevokeAndAck message, as well as the canonical // ordering used for all inputs/outputs within commitment transactions. - // If initiating a new commitment state, this signature shoud ONLY + // If initiating a new commitment state, this signature should ONLY // cover all of the sending party's pending log updates, and the log // updates of the remote party that have been ACK'd. CommitSig *btcec.Signature diff --git a/lnwire/error.go b/lnwire/error.go index 6ed86ab9..fb338c43 100644 --- a/lnwire/error.go +++ b/lnwire/error.go @@ -62,7 +62,7 @@ type ErrorData []byte // TODO(roasbeef): remove the error code type Error struct { // ChanID references the active channel in which the error occurred - // within. If the ChanID is all zeroes, then this error applies to the + // within. If the ChanID is all zeros, then this error applies to the // entire established connection. ChanID ChannelID diff --git a/lnwire/lnwire.go b/lnwire/lnwire.go index 92e693c4..450b8b21 100644 --- a/lnwire/lnwire.go +++ b/lnwire/lnwire.go @@ -17,7 +17,7 @@ import ( "github.com/roasbeef/btcutil" ) -// MaxSliceLength is the maximum allowed lenth for any opaque byte slices in +// MaxSliceLength is the maximum allowed length for any opaque byte slices in // the wire protocol. const MaxSliceLength = 65535 diff --git a/lnwire/update_add_htlc.go b/lnwire/update_add_htlc.go index ed1fa547..8f1bbd60 100644 --- a/lnwire/update_add_htlc.go +++ b/lnwire/update_add_htlc.go @@ -30,7 +30,7 @@ type UpdateAddHTLC struct { Amount MilliSatoshi // PaymentHash is the payment hash to be included in the HTLC this - // request creates. The pre-image to this HTLC must be revelaed by the + // request creates. The pre-image to this HTLC must be revealed by the // upstream peer in order to fully settle the HTLC. PaymentHash [32]byte diff --git a/peer.go b/peer.go index c296bef7..5518d4e8 100644 --- a/peer.go +++ b/peer.go @@ -585,8 +585,8 @@ func newChanMsgStream(p *peer, cid lnwire.ChannelID) *msgStream { func(msg lnwire.Message) { _, isChanSycMsg := msg.(*lnwire.ChannelReestablish) - // If this is the chanSync message, then we'll develri - // it imemdately to the active link. + // If this is the chanSync message, then we'll deliver + // it immediately to the active link. if !isChanSycMsg { // We'll send a message to the funding manager // and wait iff an active funding process for @@ -1205,7 +1205,7 @@ out: // If we're being sent a new channel, and our // existing channel doesn't have the next // revocation, then we need to update the - // current exsiting channel. + // current existing channel. if currentChan.RemoteNextRevocation() != nil { continue } @@ -1514,8 +1514,8 @@ func (p *peer) handleLocalCloseReq(req *htlcswitch.ChanClose) { // finalizeChanClosure performs the final clean up steps once the cooperative // closure transaction has been fully broadcast. The finalized closing state -// machine should be passed in. Once the transaction has been suffuciently -// confirmed, the channel will be marked as fully closed within the databaes, +// machine should be passed in. Once the transaction has been sufficiently +// confirmed, the channel will be marked as fully closed within the database, // and any clients will be notified of updates to the closing state. func (p *peer) finalizeChanClosure(chanCloser *channelCloser) { closeReq := chanCloser.CloseRequest() diff --git a/routing/chainview/interface.go b/routing/chainview/interface.go index 701296ec..bf25b8f5 100644 --- a/routing/chainview/interface.go +++ b/routing/chainview/interface.go @@ -5,7 +5,7 @@ import ( "github.com/roasbeef/btcd/wire" ) -// FilteredChainView repersents a subscription to a certain subset of of the +// FilteredChainView represents a subscription to a certain subset of of the // UTXO set for a particular chain. This interface is useful from the point of // view of maintaining an up-to-date channel graph for the Lighting Network. // The subset of the UTXO to be subscribed is that of all the currently opened diff --git a/routing/notifications.go b/routing/notifications.go index 6f1e59f5..358bf120 100644 --- a/routing/notifications.go +++ b/routing/notifications.go @@ -51,7 +51,7 @@ type topologyClientUpdate struct { } // SubscribeTopology returns a new topology client which can be used by the -// caller to receive notifications when ever a change in the channel graph +// caller to receive notifications whenever a change in the channel graph // topology occurs. Changes that will be sent at notifications include: new // nodes appearing, node updating their attributes, new channels, channels // closing, and updates in the routing policies of a channel's directed edges. diff --git a/routing/pathfind.go b/routing/pathfind.go index d19c8863..06986f12 100644 --- a/routing/pathfind.go +++ b/routing/pathfind.go @@ -109,7 +109,7 @@ type Route struct { // TotalFees is the sum of the fees paid at each hop within the final // route. In the case of a one-hop payment, this value will be zero as - // we don't need to pay a fee it ourself. + // we don't need to pay a fee to ourself. TotalFees lnwire.MilliSatoshi // TotalAmount is the total amount of funds required to complete a diff --git a/routing/pathfind_test.go b/routing/pathfind_test.go index 50793dba..31feef12 100644 --- a/routing/pathfind_test.go +++ b/routing/pathfind_test.go @@ -690,7 +690,7 @@ func TestRouteFailDisabledEdge(t *testing.T) { t.Fatalf("unable to update edge: %v", err) } - // Now, if we attempt to route throuhg that edge, we should get a + // Now, if we attempt to route through that edge, we should get a // failure as it is no longer elligble. _, err = findPath(nil, graph, sourceNode, target, ignoredVertexes, ignoredEdges, payAmt) diff --git a/routing/router.go b/routing/router.go index 882efaa4..969a978f 100644 --- a/routing/router.go +++ b/routing/router.go @@ -32,9 +32,9 @@ const ( DefaultFinalCLTVDelta = 9 ) -// ChannelGraphSource represent the source of information about the topology of -// lightning network, it responsible for addition of nodes, edges -// and applying edges updates, return the current block with with out +// ChannelGraphSource represents the source of information about the topology of +// the lightning network. It's responsible for the addition of nodes, edges, +// applying edge updates, and returning the current block height with which the // topology is synchronized. type ChannelGraphSource interface { // AddNode is used to add information about a node to the router @@ -56,7 +56,7 @@ type ChannelGraphSource interface { UpdateEdge(policy *channeldb.ChannelEdgePolicy) error // ForAllOutgoingChannels is used to iterate over all channels - // eminating from the "source" node which is the center of the + // emanating from the "source" node which is the center of the // star-graph. ForAllOutgoingChannels(cb func(c *channeldb.ChannelEdgeInfo, e *channeldb.ChannelEdgePolicy) error) error @@ -79,7 +79,7 @@ type ChannelGraphSource interface { } // FeeSchema is the set fee configuration for a Lighting Node on the network. -// Using the coefficients described within he schema, the required fee to +// Using the coefficients described within the schema, the required fee to // forward outgoing payments can be derived. type FeeSchema struct { // BaseFee is the base amount of milli-satoshis that will be chained @@ -1331,7 +1331,7 @@ type LightningPayment struct { // FinalCLTVDelta is the CTLV expiry delta to use for the _final_ hop // in the route. This means that the final hop will have a CLTV delta // of at least: currentHeight + FinalCLTVDelta. If this value is - // unspcified, then a default value of DefaultFinalCLTVDelta will be + // unspecified, then a default value of DefaultFinalCLTVDelta will be // used. FinalCLTVDelta *uint16 @@ -1740,7 +1740,7 @@ func (r *ChannelRouter) ForEachNode(cb func(*channeldb.LightningNode) error) err }) } -// ForAllOutgoingChannels is used to iterate over all outgiong channel owned by +// ForAllOutgoingChannels is used to iterate over all outgoing channels owned by // the router. // // NOTE: This method is part of the ChannelGraphSource interface. diff --git a/utxonursery.go b/utxonursery.go index ab1128a2..c154f47f 100644 --- a/utxonursery.go +++ b/utxonursery.go @@ -165,12 +165,12 @@ var byteOrder = binary.BigEndian var ( // ErrContractNotFound is returned when the nursery is unable to - // retreive information about a queried contract. + // retrieve information about a queried contract. ErrContractNotFound = fmt.Errorf("unable to locate contract") ) // NurseryConfig abstracts the required subsystems used by the utxo nursery. An -// instance of NurseryConfig is passed to newUtxoNursery during instantiationn. +// instance of NurseryConfig is passed to newUtxoNursery during instantiation. type NurseryConfig struct { // ChainIO is used by the utxo nursery to determine the current block // height, which drives the incubation of the nursery's outputs. diff --git a/zpay32/invoice.go b/zpay32/invoice.go index b45ee71b..91395c46 100644 --- a/zpay32/invoice.go +++ b/zpay32/invoice.go @@ -232,7 +232,7 @@ func RoutingInfo(routingInfo []ExtraRoutingInfo) func(*Invoice) { } // NewInvoice creates a new Invoice object. The last parameter is a set of -// variadic argumements for setting optional fields of the invoice. +// variadic arguments for setting optional fields of the invoice. // // NOTE: Either Description or DescriptionHash must be provided for the Invoice // to be considered valid.