mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-06 01:18:17 +02:00
multi: add new config QuiescenceTimeout
This commit makes removes the `defaultQuiescenceTimeout` and makes it configurable as different nodes have different network environment. In addition the default timeout has been increased from 30s to 60s.
This commit is contained in:
@@ -11,11 +11,21 @@ var (
|
||||
// where both side send 483 payments at the same time to stress test
|
||||
// lnd.
|
||||
MaxMailboxDeliveryTimeout = 2 * time.Minute
|
||||
|
||||
// minQuiescenceTimeout specifies the minimal timeout value that can be
|
||||
// used for `QuiescenceTimeout`.
|
||||
minQuiescenceTimeout = 30 * time.Second
|
||||
|
||||
// DefaultQuiescenceTimeout specifies the default value to be used for
|
||||
// `QuiescenceTimeout`.
|
||||
DefaultQuiescenceTimeout = 60 * time.Second
|
||||
)
|
||||
|
||||
//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."`
|
||||
|
||||
QuiescenceTimeout time.Duration `long:"quiescencetimeout" description:"The max duration that the channel can be quiesced. Any dependent protocols (dynamic commitments, splicing, etc.) must finish their operations under this timeout value, otherwise the node will disconnect."`
|
||||
}
|
||||
|
||||
// Validate checks the values configured for htlcswitch.
|
||||
@@ -30,5 +40,10 @@ func (h *Htlcswitch) Validate() error {
|
||||
MaxMailboxDeliveryTimeout)
|
||||
}
|
||||
|
||||
if h.QuiescenceTimeout < minQuiescenceTimeout {
|
||||
return fmt.Errorf("quiescencetimeout: %v below minimal: %v",
|
||||
h.QuiescenceTimeout, minQuiescenceTimeout)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user