mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-02 19:44:03 +02:00
contractcourt+switch: keep channels with timed-out initiated htlcs.
This commit enables the user to specify he is not interested in automatically close channels with pending payments that their corresponding htlcs have timed-out. By requiring a configurable grace period uptime of our node before closing such channels, we give a chance to the other node to properly cancel the htlc and avoid unnecessary on-chain transaction. In mobile it is very important for the user experience as otherwise channels will be force closed more frequently.
This commit is contained in:
47
config.go
47
config.go
@ -58,15 +58,16 @@ const (
|
||||
// pending channels permitted per peer.
|
||||
DefaultMaxPendingChannels = 1
|
||||
|
||||
defaultNoSeedBackup = false
|
||||
defaultTrickleDelay = 90 * 1000
|
||||
defaultChanStatusSampleInterval = time.Minute
|
||||
defaultChanEnableTimeout = 19 * time.Minute
|
||||
defaultChanDisableTimeout = 20 * time.Minute
|
||||
defaultMaxLogFiles = 3
|
||||
defaultMaxLogFileSize = 10
|
||||
defaultMinBackoff = time.Second
|
||||
defaultMaxBackoff = time.Hour
|
||||
defaultNoSeedBackup = false
|
||||
defaultPaymentsExpirationGracePeriod = time.Duration(0)
|
||||
defaultTrickleDelay = 90 * 1000
|
||||
defaultChanStatusSampleInterval = time.Minute
|
||||
defaultChanEnableTimeout = 19 * time.Minute
|
||||
defaultChanDisableTimeout = 20 * time.Minute
|
||||
defaultMaxLogFiles = 3
|
||||
defaultMaxLogFileSize = 10
|
||||
defaultMinBackoff = time.Second
|
||||
defaultMaxBackoff = time.Hour
|
||||
|
||||
defaultTorSOCKSPort = 9050
|
||||
defaultTorDNSHost = "soa.nodes.lightning.directory"
|
||||
@ -298,10 +299,11 @@ type config struct {
|
||||
|
||||
NoSeedBackup bool `long:"noseedbackup" description:"If true, NO SEED WILL BE EXPOSED AND THE WALLET WILL BE ENCRYPTED USING THE DEFAULT PASSPHRASE -- EVER. THIS FLAG IS ONLY FOR TESTING AND IS BEING DEPRECATED."`
|
||||
|
||||
TrickleDelay int `long:"trickledelay" description:"Time in milliseconds between each release of announcements to the network"`
|
||||
ChanEnableTimeout time.Duration `long:"chan-enable-timeout" description:"The duration that a peer connection must be stable before attempting to send a channel update to reenable or cancel a pending disables of the peer's channels on the network (default: 19m)."`
|
||||
ChanDisableTimeout time.Duration `long:"chan-disable-timeout" description:"The duration that must elapse after first detecting that an already active channel is actually inactive and sending channel update disabling it to the network. The pending disable can be canceled if the peer reconnects and becomes stable for chan-enable-timeout before the disable update is sent. (default: 20m)"`
|
||||
ChanStatusSampleInterval time.Duration `long:"chan-status-sample-interval" description:"The polling interval between attempts to detect if an active channel has become inactive due to its peer going offline. (default: 1m)"`
|
||||
PaymentsExpirationGracePeriod time.Duration `long:"payments-expiration-grace-period" description:"A period to wait before force closing channels with outgoing htlcs that have timed-out and are a result of this node initiated payments."`
|
||||
TrickleDelay int `long:"trickledelay" description:"Time in milliseconds between each release of announcements to the network"`
|
||||
ChanEnableTimeout time.Duration `long:"chan-enable-timeout" description:"The duration that a peer connection must be stable before attempting to send a channel update to reenable or cancel a pending disables of the peer's channels on the network (default: 19m)."`
|
||||
ChanDisableTimeout time.Duration `long:"chan-disable-timeout" description:"The duration that must elapse after first detecting that an already active channel is actually inactive and sending channel update disabling it to the network. The pending disable can be canceled if the peer reconnects and becomes stable for chan-enable-timeout before the disable update is sent. (default: 20m)"`
|
||||
ChanStatusSampleInterval time.Duration `long:"chan-status-sample-interval" description:"The polling interval between attempts to detect if an active channel has become inactive due to its peer going offline. (default: 1m)"`
|
||||
|
||||
Alias string `long:"alias" description:"The node alias. Used as a moniker by peers and intelligence services"`
|
||||
Color string `long:"color" description:"The color of the node in hex format (i.e. '#3399FF'). Used to customize node appearance in intelligence services"`
|
||||
@ -416,15 +418,16 @@ func loadConfig() (*config, error) {
|
||||
"preferential": 1.0,
|
||||
},
|
||||
},
|
||||
TrickleDelay: defaultTrickleDelay,
|
||||
ChanStatusSampleInterval: defaultChanStatusSampleInterval,
|
||||
ChanEnableTimeout: defaultChanEnableTimeout,
|
||||
ChanDisableTimeout: defaultChanDisableTimeout,
|
||||
Alias: defaultAlias,
|
||||
Color: defaultColor,
|
||||
MinChanSize: int64(minChanFundingSize),
|
||||
NumGraphSyncPeers: defaultMinPeers,
|
||||
HistoricalSyncInterval: discovery.DefaultHistoricalSyncInterval,
|
||||
PaymentsExpirationGracePeriod: defaultPaymentsExpirationGracePeriod,
|
||||
TrickleDelay: defaultTrickleDelay,
|
||||
ChanStatusSampleInterval: defaultChanStatusSampleInterval,
|
||||
ChanEnableTimeout: defaultChanEnableTimeout,
|
||||
ChanDisableTimeout: defaultChanDisableTimeout,
|
||||
Alias: defaultAlias,
|
||||
Color: defaultColor,
|
||||
MinChanSize: int64(minChanFundingSize),
|
||||
NumGraphSyncPeers: defaultMinPeers,
|
||||
HistoricalSyncInterval: discovery.DefaultHistoricalSyncInterval,
|
||||
Tor: &torConfig{
|
||||
SOCKS: defaultTorSOCKS,
|
||||
DNS: defaultTorDNS,
|
||||
|
Reference in New Issue
Block a user