multi: Fix typos [skip ci]
This commit is contained in:
139 files changed
+254
-254
No files matched your search
@@ -31,7 +31,7 @@ type invoiceExpiryTs struct {
|
||||
}
|
||||
|
||||
// Less implements PriorityQueueItem.Less such that the top item in the
|
||||
// priorty queue will be the one that expires next.
|
||||
// priority queue will be the one that expires next.
|
||||
func (e invoiceExpiryTs) Less(other queue.PriorityQueueItem) bool {
|
||||
return e.Expiry.Before(other.(*invoiceExpiryTs).Expiry)
|
||||
}
|
||||
@@ -58,10 +58,10 @@ func (b invoiceExpiryHeight) expired(currentHeight, delta uint32) bool {
|
||||
return currentHeight+delta >= b.expiryHeight
|
||||
}
|
||||
|
||||
// InvoiceExpiryWatcher handles automatic invoice cancellation of expried
|
||||
// InvoiceExpiryWatcher handles automatic invoice cancellation of expired
|
||||
// invoices. Upon start InvoiceExpiryWatcher will retrieve all pending (not yet
|
||||
// settled or canceled) invoices invoices to its watcing queue. When a new
|
||||
// invoice is added to the InvoiceRegistry, it'll be forarded to the
|
||||
// settled or canceled) invoices invoices to its watching queue. When a new
|
||||
// invoice is added to the InvoiceRegistry, it'll be forwarded to the
|
||||
// InvoiceExpiryWatcher and will end up in the watching queue as well.
|
||||
// If any of the watched invoices expire, they'll be removed from the watching
|
||||
// queue and will be cancelled through InvoiceRegistry.CancelInvoice().
|
||||
|
||||
@@ -630,7 +630,7 @@ func (i *InvoiceRegistry) cancelSingleHtlc(invoiceRef channeldb.InvoiceRef,
|
||||
updateInvoice := func(invoice *channeldb.Invoice) (
|
||||
*channeldb.InvoiceUpdateDesc, error) {
|
||||
|
||||
// Only allow individual htlc cancelation on open invoices.
|
||||
// Only allow individual htlc cancellation on open invoices.
|
||||
if invoice.State != channeldb.ContractOpen {
|
||||
log.Debugf("cancelSingleHtlc: invoice %v no longer "+
|
||||
"open", invoiceRef)
|
||||
@@ -669,7 +669,7 @@ func (i *InvoiceRegistry) cancelSingleHtlc(invoiceRef channeldb.InvoiceRef,
|
||||
htlcState = htlc.State
|
||||
}
|
||||
|
||||
// Cancelation is only possible if the htlc wasn't already
|
||||
// Cancellation is only possible if the htlc wasn't already
|
||||
// resolved.
|
||||
if htlcState != channeldb.HtlcStateAccepted {
|
||||
log.Debugf("cancelSingleHtlc: htlc %v on invoice %v "+
|
||||
@@ -1248,7 +1248,7 @@ func shouldCancel(state channeldb.ContractState, cancelAccepted bool) bool {
|
||||
}
|
||||
|
||||
// If the invoice is accepted, we should only cancel if we want to
|
||||
// force cancelation of accepted invoices.
|
||||
// force cancellation of accepted invoices.
|
||||
return cancelAccepted
|
||||
}
|
||||
|
||||
@@ -1396,7 +1396,7 @@ type InvoiceSubscription struct {
|
||||
// StartingInvoiceIndex field.
|
||||
NewInvoices chan *channeldb.Invoice
|
||||
|
||||
// SettledInvoices is a channel that we'll use to send all setted
|
||||
// SettledInvoices is a channel that we'll use to send all settled
|
||||
// invoices with an invoices index greater than the specified
|
||||
// StartingInvoiceIndex field.
|
||||
SettledInvoices chan *channeldb.Invoice
|
||||
|
||||
@@ -183,10 +183,10 @@ func TestSettleInvoice(t *testing.T) {
|
||||
// Try to cancel.
|
||||
err = ctx.registry.CancelInvoice(testInvoicePaymentHash)
|
||||
if err != channeldb.ErrInvoiceAlreadySettled {
|
||||
t.Fatal("expected cancelation of a settled invoice to fail")
|
||||
t.Fatal("expected cancellation of a settled invoice to fail")
|
||||
}
|
||||
|
||||
// As this is a direct sette, we expect nothing on the hodl chan.
|
||||
// As this is a direct settle, we expect nothing on the hodl chan.
|
||||
select {
|
||||
case <-hodlChan:
|
||||
t.Fatal("unexpected resolution")
|
||||
@@ -325,10 +325,10 @@ func testCancelInvoice(t *testing.T, gc bool) {
|
||||
require.Equal(t, testCurrentHeight, failResolution.AcceptHeight)
|
||||
}
|
||||
|
||||
// TestCancelInvoice tests cancelation of an invoice and related notifications.
|
||||
// TestCancelInvoice tests cancellation of an invoice and related notifications.
|
||||
func TestCancelInvoice(t *testing.T) {
|
||||
// Test cancellation both with garbage collection (meaning that canceled
|
||||
// invoice will be deleted) and without (meain it'll be kept).
|
||||
// invoice will be deleted) and without (meaning it'll be kept).
|
||||
t.Run("garbage collect", func(t *testing.T) {
|
||||
testCancelInvoice(t, true)
|
||||
})
|
||||
@@ -507,7 +507,7 @@ func TestSettleHoldInvoice(t *testing.T) {
|
||||
// Try to cancel.
|
||||
err = registry.CancelInvoice(testInvoicePaymentHash)
|
||||
if err == nil {
|
||||
t.Fatal("expected cancelation of a settled invoice to fail")
|
||||
t.Fatal("expected cancellation of a settled invoice to fail")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1074,7 +1074,7 @@ func TestOldInvoiceRemovalOnStart(t *testing.T) {
|
||||
|
||||
i := 0
|
||||
for paymentHash, invoice := range existingInvoices.expiredInvoices {
|
||||
// Mark half of the invoices as settled, the other hald as
|
||||
// Mark half of the invoices as settled, the other half as
|
||||
// canceled.
|
||||
if i%2 == 0 {
|
||||
invoice.State = channeldb.ContractSettled
|
||||
@@ -1225,7 +1225,7 @@ func testHeightExpiryWithRegistry(t *testing.T, numParts int, settle bool) {
|
||||
}
|
||||
|
||||
// If we did not settle the invoice before its expiry, we now expect
|
||||
// a cancelation.
|
||||
// a cancellation.
|
||||
expectedState := channeldb.ContractSettled
|
||||
if !settle {
|
||||
expectedState = channeldb.ContractCanceled
|
||||
|
||||
+1
-1
@@ -286,7 +286,7 @@ type HTLCPreimages = map[channeldb.CircuitKey]lntypes.Preimage
|
||||
// verifies that all derived child hashes match the payment hashes of the HTLCs
|
||||
// in the set. This method is meant to be called after receiving the full amount
|
||||
// committed to via mpp_total_msat. This method will return a fail resolution if
|
||||
// any of the child hashes fail to matche theire corresponding HTLCs.
|
||||
// any of the child hashes fail to match their corresponding HTLCs.
|
||||
func reconstructAMPPreimages(ctx *invoiceUpdateCtx,
|
||||
htlcSet HTLCSet) (HTLCPreimages, *HtlcFailResolution) {
|
||||
|
||||
|
||||
Reference in new issue
Block a user