Skip to content

Commit

Permalink
multi: fix several typos in godoc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MDrollette authored and Roasbeef committed Dec 18, 2017
1 parent b74a281 commit adf0d98
Show file tree
Hide file tree
Showing 37 changed files with 70 additions and 70 deletions.
2 changes: 1 addition & 1 deletion autopilot/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions breacharbiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions breacharbiter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 "+
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion brontide/noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions chainntnfs/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion chainntnfs/neutrinonotify/neutrino.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion chainntnfs/txconfnotifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion channeldb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions channeldb/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion channeldb/payments.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion discovery/bootstrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion htlcswitch/mailbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion lntest/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lnwallet/btcwallet/btcwallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions lnwallet/btcwallet/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions lnwallet/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion lnwallet/fee_estimator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lnwallet/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions lnwallet/script_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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[:])
Expand Down
4 changes: 2 additions & 2 deletions lnwallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions lnwire/announcement_signatures.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lnwire/channel_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions lnwire/channel_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading

0 comments on commit adf0d98

Please sign in to comment.