lncfg+lnd: add new dev config unsafeconnect

This flag is added so we can use it in the itest to mimic racing inbound
and outbound connections.
This commit is contained in:
yyforyongyu
2025-05-31 01:39:09 +08:00
parent cc7ed5a9d2
commit 599650fa2d
3 changed files with 17 additions and 1 deletions

View File

@@ -52,3 +52,9 @@ func (d *DevConfig) GetZombieSweeperInterval() time.Duration {
func (d *DevConfig) GetMaxWaitNumBlocksFundingConf() uint32 {
return DefaultMaxWaitNumBlocksFundingConf
}
// GetUnsafeConnect returns the config value `UnsafeConnect`, which is always
// false for production build.
func (d *DevConfig) GetUnsafeConnect() bool {
return false
}

View File

@@ -26,6 +26,7 @@ type DevConfig struct {
ZombieSweeperInterval time.Duration `long:"zombiesweeperinterval" description:"The time interval at which channel opening flows are evaluated for zombie status."`
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."`
}
// ChannelReadyWait returns the config value `ProcessChannelReadyWait`.
@@ -65,3 +66,8 @@ func (d *DevConfig) GetMaxWaitNumBlocksFundingConf() uint32 {
return d.MaxWaitNumBlocksFundingConf
}
// GetUnsafeConnect returns the config value `UnsafeConnect`.
func (d *DevConfig) GetUnsafeConnect() bool {
return d.UnsafeConnect
}