mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-30 23:53:41 +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:
@@ -301,6 +301,12 @@ type ChannelLinkConfig struct {
|
||||
// AuxTrafficShaper is an optional auxiliary traffic shaper that can be
|
||||
// used to manage the bandwidth of the link.
|
||||
AuxTrafficShaper fn.Option[AuxTrafficShaper]
|
||||
|
||||
// QuiescenceTimeout is 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.
|
||||
QuiescenceTimeout time.Duration
|
||||
}
|
||||
|
||||
// channelLink is the service which drives a channel's commitment update
|
||||
@@ -497,7 +503,7 @@ func NewChannelLink(cfg ChannelLinkConfig,
|
||||
sendMsg: func(s lnwire.Stfu) error {
|
||||
return cfg.Peer.SendMessage(false, &s)
|
||||
},
|
||||
timeoutDuration: defaultQuiescenceTimeout,
|
||||
timeoutDuration: cfg.QuiescenceTimeout,
|
||||
onTimeout: func() {
|
||||
cfg.Peer.Disconnect(ErrQuiescenceTimeout)
|
||||
},
|
||||
|
@@ -47,13 +47,9 @@ var (
|
||||
|
||||
// ErrQuiescenceTimeout indicates that the quiescer has been quiesced
|
||||
// beyond the allotted time.
|
||||
ErrQuiescenceTimeout = fmt.Errorf(
|
||||
"quiescence timeout",
|
||||
)
|
||||
ErrQuiescenceTimeout = fmt.Errorf("quiescence timeout")
|
||||
)
|
||||
|
||||
const defaultQuiescenceTimeout = 30 * time.Second
|
||||
|
||||
type StfuReq = fn.Req[fn.Unit, fn.Result[lntypes.ChannelParty]]
|
||||
|
||||
// Quiescer is the public interface of the quiescence mechanism. Callers of the
|
||||
|
Reference in New Issue
Block a user