mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 06:07:16 +01:00
multi: Add itest for funding timeout
This commit adds an integration test that verifies the funding timeout behavior in the funding manager, in dev/integration test. Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
This commit is contained in:
@@ -72,6 +72,11 @@ const (
|
||||
// DefaultZombieSweeperInterval is the default time interval at which
|
||||
// unfinished (zombiestate) open channel flows are purged from memory.
|
||||
DefaultZombieSweeperInterval = 1 * time.Minute
|
||||
|
||||
// DefaultMaxWaitNumBlocksFundingConf is the maximum number of blocks to
|
||||
// wait for the funding transaction to confirm before forgetting
|
||||
// channels that aren't initiated by us. 2016 blocks is ~2 weeks.
|
||||
DefaultMaxWaitNumBlocksFundingConf = 2016
|
||||
)
|
||||
|
||||
// CleanAndExpandPath expands environment variables and leading ~ in the
|
||||
|
||||
@@ -46,3 +46,9 @@ func (d *DevConfig) GetReservationTimeout() time.Duration {
|
||||
func (d *DevConfig) GetZombieSweeperInterval() time.Duration {
|
||||
return DefaultZombieSweeperInterval
|
||||
}
|
||||
|
||||
// GetMaxWaitNumBlocksFundingConf returns the config value for
|
||||
// `MaxWaitNumBlocksFundingConf`.
|
||||
func (d *DevConfig) GetMaxWaitNumBlocksFundingConf() uint32 {
|
||||
return DefaultMaxWaitNumBlocksFundingConf
|
||||
}
|
||||
|
||||
@@ -21,10 +21,11 @@ func IsDevBuild() bool {
|
||||
//
|
||||
//nolint:ll
|
||||
type DevConfig struct {
|
||||
ProcessChannelReadyWait time.Duration `long:"processchannelreadywait" description:"Time to sleep before processing remote node's channel_ready message."`
|
||||
ReservationTimeout time.Duration `long:"reservationtimeout" description:"The maximum time we keep a pending channel open flow in memory."`
|
||||
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."`
|
||||
ProcessChannelReadyWait time.Duration `long:"processchannelreadywait" description:"Time to sleep before processing remote node's channel_ready message."`
|
||||
ReservationTimeout time.Duration `long:"reservationtimeout" description:"The maximum time we keep a pending channel open flow in memory."`
|
||||
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."`
|
||||
}
|
||||
|
||||
// ChannelReadyWait returns the config value `ProcessChannelReadyWait`.
|
||||
@@ -54,3 +55,13 @@ func (d *DevConfig) GetZombieSweeperInterval() time.Duration {
|
||||
func (d *DevConfig) GetUnsafeDisconnect() bool {
|
||||
return d.UnsafeDisconnect
|
||||
}
|
||||
|
||||
// GetMaxWaitNumBlocksFundingConf returns the config value for
|
||||
// `MaxWaitNumBlocksFundingConf`.
|
||||
func (d *DevConfig) GetMaxWaitNumBlocksFundingConf() uint32 {
|
||||
if d.MaxWaitNumBlocksFundingConf == 0 {
|
||||
return DefaultMaxWaitNumBlocksFundingConf
|
||||
}
|
||||
|
||||
return d.MaxWaitNumBlocksFundingConf
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user