mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-19 05:45:21 +01:00
ab7aae0708
Find and replace all nolint instances refering to the `lll` linter and replace with `ll` which is the name of our custom version of the `lll` linter which can be used to ignore log lines during linting. The next commit will do the configuration of the custom linter and disable the default one.
35 lines
1.0 KiB
Go
35 lines
1.0 KiB
Go
package lncfg
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
var (
|
|
// MaxMailboxDeliveryTimeout specifies the max allowed timeout value.
|
|
// This value is derived from the itest `async_bidirectional_payments`,
|
|
// where both side send 483 payments at the same time to stress test
|
|
// lnd.
|
|
MaxMailboxDeliveryTimeout = 2 * time.Minute
|
|
)
|
|
|
|
//nolint:ll
|
|
type Htlcswitch struct {
|
|
MailboxDeliveryTimeout time.Duration `long:"mailboxdeliverytimeout" description:"The timeout value when delivering HTLCs to a channel link. Setting this value too small will result in local payment failures if large number of payments are sent over a short period."`
|
|
}
|
|
|
|
// Validate checks the values configured for htlcswitch.
|
|
func (h *Htlcswitch) Validate() error {
|
|
if h.MailboxDeliveryTimeout <= 0 {
|
|
return fmt.Errorf("mailboxdeliverytimeout must be positive")
|
|
}
|
|
|
|
if h.MailboxDeliveryTimeout > MaxMailboxDeliveryTimeout {
|
|
return fmt.Errorf("mailboxdeliverytimeout: %v exceeds "+
|
|
"maximum: %v", h.MailboxDeliveryTimeout,
|
|
MaxMailboxDeliveryTimeout)
|
|
}
|
|
|
|
return nil
|
|
}
|