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:
1 parent
931b54e848
commit
622fa4476f
2 files changed
+19
No files matched your search
@@ -5,6 +5,7 @@ package lncfg
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/lightningnetwork/lnd/fn/v2"
|
||||||
"github.com/lightningnetwork/lnd/lnwallet/chanfunding"
|
"github.com/lightningnetwork/lnd/lnwallet/chanfunding"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -58,3 +59,9 @@ func (d *DevConfig) GetMaxWaitNumBlocksFundingConf() uint32 {
|
|||||||
func (d *DevConfig) GetUnsafeConnect() bool {
|
func (d *DevConfig) GetUnsafeConnect() bool {
|
||||||
return false
|
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 (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/lightningnetwork/lnd/fn/v2"
|
||||||
"github.com/lightningnetwork/lnd/lnwallet/chanfunding"
|
"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."`
|
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."`
|
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."`
|
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`.
|
// ChannelReadyWait returns the config value `ProcessChannelReadyWait`.
|
||||||
@@ -71,3 +73,13 @@ func (d *DevConfig) GetMaxWaitNumBlocksFundingConf() uint32 {
|
|||||||
func (d *DevConfig) GetUnsafeConnect() bool {
|
func (d *DevConfig) GetUnsafeConnect() bool {
|
||||||
return d.UnsafeConnect
|
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)
|
||||||
|
}
|
||||||
Reference in new issue
Block a user