multi: Fix typos [skip ci]
This commit is contained in:
139 files changed
+254
-254
No files matched your search
@@ -231,7 +231,7 @@ func (b *BitcoindFilteredChainView) FilterBlock(blockHash *chainhash.Hash) (*Fil
|
||||
|
||||
// chainFilterer is the primary goroutine which: listens for new blocks coming
|
||||
// and dispatches the relevant FilteredBlock notifications, updates the filter
|
||||
// due to requests by callers, and finally is able to preform targeted block
|
||||
// due to requests by callers, and finally is able to perform targeted block
|
||||
// filtration.
|
||||
//
|
||||
// TODO(roasbeef): change to use loadfilter RPC's
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
// restarts. Payments are transitioned through various payment states, and the
|
||||
// ControlTower interface provides access to driving the state transitions.
|
||||
type ControlTower interface {
|
||||
// This method checks that no suceeded payment exist for this payment
|
||||
// This method checks that no succeeded payment exist for this payment
|
||||
// hash.
|
||||
InitPayment(lntypes.Hash, *channeldb.PaymentCreationInfo) error
|
||||
|
||||
@@ -117,7 +117,7 @@ func NewControlTower(db *channeldb.PaymentControl) ControlTower {
|
||||
|
||||
// InitPayment checks or records the given PaymentCreationInfo with the DB,
|
||||
// making sure it does not already exist as an in-flight payment. Then this
|
||||
// method returns successfully, the payment is guranteeed to be in the InFlight
|
||||
// method returns successfully, the payment is guaranteed to be in the InFlight
|
||||
// state.
|
||||
func (p *controlTower) InitPayment(paymentHash lntypes.Hash,
|
||||
info *channeldb.PaymentCreationInfo) error {
|
||||
@@ -258,7 +258,7 @@ func (p *controlTower) SubscribePayment(paymentHash lntypes.Hash) (
|
||||
// notifySubscribers sends a final payment event to all subscribers of this
|
||||
// payment. The channel will be closed after this. Note that this function must
|
||||
// be executed atomically (by means of a lock) with the database update to
|
||||
// guarantuee consistency of the notifications.
|
||||
// guarantee consistency of the notifications.
|
||||
func (p *controlTower) notifySubscribers(paymentHash lntypes.Hash,
|
||||
event *channeldb.MPPayment) {
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ const (
|
||||
// funding transaction described by the short channel ID on chain.
|
||||
ErrNoFundingTransaction
|
||||
|
||||
// ErrInvalidFundingOutput is returned if the channle funding output
|
||||
// ErrInvalidFundingOutput is returned if the channel funding output
|
||||
// fails validation.
|
||||
ErrInvalidFundingOutput
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ const (
|
||||
// DefaultMaxMcHistory is the default maximum history size.
|
||||
DefaultMaxMcHistory = 1000
|
||||
|
||||
// DefaultMcFlushInterval is the defaul inteval we use to flush MC state
|
||||
// DefaultMcFlushInterval is the default interval we use to flush MC state
|
||||
// to the database.
|
||||
DefaultMcFlushInterval = time.Second
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ func (m *missionControlState) setLastPairResult(fromNode, toNode route.Vertex,
|
||||
} else {
|
||||
// For failures we always want to update both the amount and the
|
||||
// time. Those need to relate to the same result, because the
|
||||
// time is used to gradually diminish the penality for that
|
||||
// time is used to gradually diminish the penalty for that
|
||||
// specific result. Updating the timestamp but not the amount
|
||||
// could cause a failure for a lower amount (a more severe
|
||||
// condition) to be revived as if it just happened.
|
||||
|
||||
@@ -2861,7 +2861,7 @@ func runEqualCostRouteSelection(t *testing.T, useCache bool) {
|
||||
// Set up a test graph with two possible paths to the target: via a and
|
||||
// via b. The routing fees and probabilities are chosen such that the
|
||||
// algorithm will first explore target->a->source (backwards search).
|
||||
// This route has fee 6 and a penality of 4 for the 25% success
|
||||
// This route has fee 6 and a penalty of 4 for the 25% success
|
||||
// probability. The algorithm will then proceed with evaluating
|
||||
// target->b->source, which has a fee of 8 and a penalty of 2 for the
|
||||
// 50% success probability. Both routes have the same path finding cost
|
||||
|
||||
@@ -669,9 +669,9 @@ func (p *shardHandler) createNewPaymentAttempt(rt *route.Route, lastShard bool)
|
||||
return lnwire.ShortChannelID{}, nil, nil, err
|
||||
}
|
||||
|
||||
// Requesst a new shard from the ShardTracker. If this is an AMP
|
||||
// Request a new shard from the ShardTracker. If this is an AMP
|
||||
// payment, and this is the last shard, the outstanding shards together
|
||||
// with ths one will be enough for the receiver to derive all HTLC
|
||||
// with this one will be enough for the receiver to derive all HTLC
|
||||
// preimages. If this a non-AMP payment, the ShardTracker will return a
|
||||
// simple shard with the payment's static payment hash.
|
||||
shard, err := p.shardTracker.NewShard(attemptID, lastShard)
|
||||
|
||||
@@ -352,7 +352,7 @@ func TestRouterPaymentStateMachine(t *testing.T) {
|
||||
},
|
||||
{
|
||||
// Tests that the router is able to handle the
|
||||
// receieved payment result after a restart.
|
||||
// received payment result after a restart.
|
||||
name: "single shot restart",
|
||||
|
||||
steps: []string{
|
||||
@@ -453,7 +453,7 @@ func testPaymentLifecycle(t *testing.T, test paymentLifecycleTestCase,
|
||||
chainView := newMockChainView(chain)
|
||||
|
||||
// We set uo the use the following channels and a mock Payer to
|
||||
// synchonize with the interaction to the Switch.
|
||||
// synchronize with the interaction to the Switch.
|
||||
sendResult := make(chan error)
|
||||
paymentResult := make(chan *htlcswitch.PaymentResult)
|
||||
|
||||
@@ -688,7 +688,7 @@ func testPaymentLifecycle(t *testing.T, test paymentLifecycleTestCase,
|
||||
|
||||
// In this state we expect the router to call the
|
||||
// GetPaymentResult method, and we will respond with a
|
||||
// terminal error, indiating the router should stop
|
||||
// terminal error, indicating the router should stop
|
||||
// making payment attempts.
|
||||
case getPaymentResultTerminalFailure:
|
||||
failure := htlcswitch.NewForwardingError(
|
||||
|
||||
@@ -190,7 +190,7 @@ func (i *interpretedResult) processPaymentOutcomeFinal(
|
||||
// from its predecessor.
|
||||
i.failPair(route, n-1)
|
||||
|
||||
// The other hops relayed corectly, so assign those pairs a
|
||||
// The other hops relayed correctly, so assign those pairs a
|
||||
// success result. At this point, n >= 2.
|
||||
i.successPairRange(route, 0, n-2)
|
||||
|
||||
|
||||
+2
-2
@@ -195,7 +195,7 @@ type PaymentAttemptDispatcher interface {
|
||||
}
|
||||
|
||||
// PaymentSessionSource is an interface that defines a source for the router to
|
||||
// retrive new payment sessions.
|
||||
// retrieve new payment sessions.
|
||||
type PaymentSessionSource interface {
|
||||
// NewPaymentSession creates a new payment session that will produce
|
||||
// routes to the given target. An optional set of routing hints can be
|
||||
@@ -2579,7 +2579,7 @@ func (r *ChannelRouter) IsKnownEdge(chanID lnwire.ShortChannelID) bool {
|
||||
return exists || isZombie
|
||||
}
|
||||
|
||||
// IsStaleEdgePolicy returns true if the graph soruce has a channel edge for
|
||||
// IsStaleEdgePolicy returns true if the graph source has a channel edge for
|
||||
// the passed channel ID (and flags) that have a more recent timestamp.
|
||||
//
|
||||
// NOTE: This method is part of the ChannelGraphSource interface.
|
||||
|
||||
@@ -858,7 +858,7 @@ func TestSendPaymentPrivateEdgeUpdateFeeExceedsLimit(t *testing.T) {
|
||||
|
||||
// TestSendPaymentErrorNonFinalTimeLockErrors tests that if we receive either
|
||||
// an ExpiryTooSoon or a IncorrectCltvExpiry error from a node, then we prune
|
||||
// that node from the available graph witin a mission control session. This
|
||||
// that node from the available graph within a mission control session. This
|
||||
// test ensures that we'll route around errors due to nodes not knowing the
|
||||
// current block height.
|
||||
func TestSendPaymentErrorNonFinalTimeLockErrors(t *testing.T) {
|
||||
|
||||
@@ -24,7 +24,7 @@ type PaymentShard interface {
|
||||
AMP() *record.AMP
|
||||
}
|
||||
|
||||
// ShardTracker is an interfae representing a tracker that keeps track of the
|
||||
// ShardTracker is an interface representing a tracker that keeps track of the
|
||||
// inflight shards of a payment, and is able to assign new shards the correct
|
||||
// options such as hash and extra records.
|
||||
type ShardTracker interface {
|
||||
@@ -41,11 +41,11 @@ type ShardTracker interface {
|
||||
CancelShard(uint64) error
|
||||
|
||||
// GetHash retrieves the hash used by the shard of the given attempt
|
||||
// ID. This wil return an error if the attempt ID is unknown.
|
||||
// ID. This will return an error if the attempt ID is unknown.
|
||||
GetHash(uint64) (lntypes.Hash, error)
|
||||
}
|
||||
|
||||
// Shard is a struct used for simple shards where we obly need to keep map it
|
||||
// Shard is a struct used for simple shards where we only need to keep map it
|
||||
// to a single hash.
|
||||
type Shard struct {
|
||||
hash lntypes.Hash
|
||||
@@ -82,7 +82,7 @@ type SimpleShardTracker struct {
|
||||
// ShardTracker interface.
|
||||
var _ ShardTracker = (*SimpleShardTracker)(nil)
|
||||
|
||||
// NewSimpleShardTracker creates a new intance of the SimpleShardTracker with
|
||||
// NewSimpleShardTracker creates a new instance of the SimpleShardTracker with
|
||||
// the given payment hash and existing attempts.
|
||||
func NewSimpleShardTracker(paymentHash lntypes.Hash,
|
||||
shards map[uint64]lntypes.Hash) ShardTracker {
|
||||
|
||||
@@ -28,7 +28,7 @@ func TestSimpleShardTracker(t *testing.T) {
|
||||
_, err := tracker.GetHash(0)
|
||||
require.Error(t, err)
|
||||
|
||||
// Getting id 1 should workd.
|
||||
// Getting id 1 should work.
|
||||
hash1, err := tracker.GetHash(1)
|
||||
require.NoError(t, err)
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ type validationSignals struct {
|
||||
// validate the item on the left of the arrow before that on the right.
|
||||
type ValidationBarrier struct {
|
||||
// validationSemaphore is a channel of structs which is used as a
|
||||
// sempahore. Initially we'll fill this with a buffered channel of the
|
||||
// semaphore. Initially we'll fill this with a buffered channel of the
|
||||
// size of the number of active requests. Each new job will consume
|
||||
// from this channel, then restore the value upon completion.
|
||||
validationSemaphore chan struct{}
|
||||
@@ -68,7 +68,7 @@ func NewValidationBarrier(numActiveReqs int,
|
||||
quit: quitChan,
|
||||
}
|
||||
|
||||
// We'll first initialize a set of sempahores to limit our concurrency
|
||||
// We'll first initialize a set of semaphores to limit our concurrency
|
||||
// when validating incoming requests in parallel.
|
||||
v.validationSemaphore = make(chan struct{}, numActiveReqs)
|
||||
for i := 0; i < numActiveReqs; i++ {
|
||||
|
||||
Reference in new issue
Block a user