2023-06-14 00:14:17 +02:00
|
|
|
//go:build !integration
|
|
|
|
|
|
|
|
package lncfg
|
|
|
|
|
2024-01-21 17:30:32 +01:00
|
|
|
import (
|
|
|
|
"time"
|
2024-02-21 22:20:19 +01:00
|
|
|
|
|
|
|
"github.com/lightningnetwork/lnd/lnwallet/chanfunding"
|
2024-01-21 17:30:32 +01:00
|
|
|
)
|
2023-06-14 00:14:17 +02:00
|
|
|
|
|
|
|
// IsDevBuild returns a bool to indicate whether we are in a development
|
|
|
|
// environment.
|
|
|
|
//
|
|
|
|
// NOTE: always return false here.
|
|
|
|
func IsDevBuild() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
// DevConfig specifies development configs used for production. This struct
|
|
|
|
// should always remain empty.
|
|
|
|
type DevConfig struct{}
|
|
|
|
|
|
|
|
// ChannelReadyWait returns the config value, which is always 0 for production
|
|
|
|
// build.
|
|
|
|
func (d *DevConfig) ChannelReadyWait() time.Duration {
|
|
|
|
return 0
|
|
|
|
}
|
2024-01-21 17:30:32 +01:00
|
|
|
|
2024-01-31 10:13:38 +01:00
|
|
|
// GetUnsafeDisconnect returns the config value, which is always true for
|
|
|
|
// production build.
|
|
|
|
//
|
|
|
|
// TODO(yy): this is a temporary solution to allow users to reconnect peers to
|
|
|
|
// trigger a reestablishiment for the active channels. Once a new dedicated RPC
|
|
|
|
// is added to realize that functionality, this function should return false to
|
|
|
|
// forbidden disconnecting peers while there are active channels.
|
|
|
|
func (d *DevConfig) GetUnsafeDisconnect() bool {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2024-01-21 17:30:32 +01:00
|
|
|
// GetReservationTimeout returns the config value for `ReservationTimeout`.
|
|
|
|
func (d *DevConfig) GetReservationTimeout() time.Duration {
|
2024-02-21 22:20:19 +01:00
|
|
|
return chanfunding.DefaultReservationTimeout
|
2024-01-21 17:30:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetZombieSweeperInterval returns the config value for`ZombieSweeperInterval`.
|
|
|
|
func (d *DevConfig) GetZombieSweeperInterval() time.Duration {
|
|
|
|
return DefaultZombieSweeperInterval
|
|
|
|
}
|