mirror of
https://github.com/lightningnetwork/lnd.git
synced 2026-08-18 13:07:58 +02:00
lncfg: add new dev config option for scaling channel close confs
This'll be useful for the set up upcoming itests.
This commit is contained in:
parent
931b54e848
commit
622fa4476f
2 changed files with 19 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ package lncfg
|
|||
import (
|
||||
"time"
|
||||
|
||||
"github.com/lightningnetwork/lnd/fn/v2"
|
||||
"github.com/lightningnetwork/lnd/lnwallet/chanfunding"
|
||||
)
|
||||
|
||||
|
|
@ -58,3 +59,9 @@ func (d *DevConfig) GetMaxWaitNumBlocksFundingConf() uint32 {
|
|||
func (d *DevConfig) GetUnsafeConnect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// ChannelCloseConfs returns the config value for channel close confirmations
|
||||
// override, which is always None for production build.
|
||||
func (d *DevConfig) ChannelCloseConfs() fn.Option[uint32] {
|
||||
return fn.None[uint32]()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ package lncfg
|
|||
import (
|
||||
"time"
|
||||
|
||||
"github.com/lightningnetwork/lnd/fn/v2"
|
||||
"github.com/lightningnetwork/lnd/lnwallet/chanfunding"
|
||||
)
|
||||
|
||||
|
|
@ -27,6 +28,7 @@ type DevConfig struct {
|
|||
UnsafeDisconnect bool `long:"unsafedisconnect" description:"Allows the rpcserver to intentionally disconnect from peers with open channels."`
|
||||
MaxWaitNumBlocksFundingConf uint32 `long:"maxwaitnumblocksfundingconf" description:"Maximum blocks to wait for funding confirmation before discarding non-initiated channels."`
|
||||
UnsafeConnect bool `long:"unsafeconnect" description:"Allow the rpcserver to connect to a peer even if there's already a connection."`
|
||||
ForceChannelCloseConfs uint32 `long:"force-channel-close-confs" description:"Force a specific number of confirmations for channel closes (dev/test only)"`
|
||||
}
|
||||
|
||||
// ChannelReadyWait returns the config value `ProcessChannelReadyWait`.
|
||||
|
|
@ -71,3 +73,13 @@ func (d *DevConfig) GetMaxWaitNumBlocksFundingConf() uint32 {
|
|||
func (d *DevConfig) GetUnsafeConnect() bool {
|
||||
return d.UnsafeConnect
|
||||
}
|
||||
|
||||
// ChannelCloseConfs returns the forced confirmation count if set, or None if
|
||||
// the default behavior should be used.
|
||||
func (d *DevConfig) ChannelCloseConfs() fn.Option[uint32] {
|
||||
if d.ForceChannelCloseConfs == 0 {
|
||||
return fn.None[uint32]()
|
||||
}
|
||||
|
||||
return fn.Some(d.ForceChannelCloseConfs)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue