Skip to content

Commit

Permalink
multi: Fix typos [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
rex4539 committed Jan 24, 2022
1 parent f509506 commit 530a205
Show file tree
Hide file tree
Showing 139 changed files with 254 additions and 254 deletions.
2 changes: 1 addition & 1 deletion aezeed/cipherseed.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down
4 changes: 2 additions & 2 deletions autopilot/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions autopilot/betweenness_centrality.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand All @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion autopilot/centrality_testdata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
4 changes: 2 additions & 2 deletions autopilot/choice.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion autopilot/combinedattach.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion build/log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion build/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
8 changes: 4 additions & 4 deletions chainntnfs/txnotifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions chainntnfs/txnotifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion chanacceptor/rpcacceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions channeldb/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions channeldb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions channeldb/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions channeldb/forwarding_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions channeldb/invoices.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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 {

Expand Down
2 changes: 1 addition & 1 deletion channeldb/migration/lnwire21/gossip_timestamp_range.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion channeldb/migration21/current/current_encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion channeldb/migration21/legacy/legacy_decoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions channeldb/migration21/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion channeldb/migration_01_to_11/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion channeldb/migration_01_to_11/migrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion channeldb/migration_01_to_11/zpay32/invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion channeldb/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions channeldb/payment_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
Loading

0 comments on commit 530a205

Please sign in to comment.