config: add new command line param --defaultchanconfs
This commit adds a new command line option that allows clients to specify a default value to use when responding to a new channel funding request. In a future change, a pure mapping will be added, with the command line option having higher precedence.
This commit is contained in:
parent
747e0f57d1
commit
828c650bbc
20
config.go
20
config.go
@ -30,6 +30,7 @@ const (
|
|||||||
defaultPeerPort = 5656
|
defaultPeerPort = 5656
|
||||||
defaultRPCHost = "localhost"
|
defaultRPCHost = "localhost"
|
||||||
defaultMaxPendingChannels = 1
|
defaultMaxPendingChannels = 1
|
||||||
|
defaultNumChanConfs = 1
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -96,6 +97,8 @@ type config struct {
|
|||||||
Litecoin *chainConfig `group:"Litecoin" namespace:"litecoin"`
|
Litecoin *chainConfig `group:"Litecoin" namespace:"litecoin"`
|
||||||
Bitcoin *chainConfig `group:"Bitcoin" namespace:"bitcoin"`
|
Bitcoin *chainConfig `group:"Bitcoin" namespace:"bitcoin"`
|
||||||
|
|
||||||
|
DefaultNumChanConfs int `long:"defaultchanconfs" description:"The default number of confirmations a channel must have before it's considered open."`
|
||||||
|
|
||||||
NeutrinoMode *neutrinoConfig `group:"neutrino" namespace:"neutrino"`
|
NeutrinoMode *neutrinoConfig `group:"neutrino" namespace:"neutrino"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,14 +112,15 @@ type config struct {
|
|||||||
// 4) Parse CLI options and overwrite/add any specified options
|
// 4) Parse CLI options and overwrite/add any specified options
|
||||||
func loadConfig() (*config, error) {
|
func loadConfig() (*config, error) {
|
||||||
defaultCfg := config{
|
defaultCfg := config{
|
||||||
ConfigFile: defaultConfigFile,
|
ConfigFile: defaultConfigFile,
|
||||||
DataDir: defaultDataDir,
|
DataDir: defaultDataDir,
|
||||||
DebugLevel: defaultLogLevel,
|
DebugLevel: defaultLogLevel,
|
||||||
LogDir: defaultLogDir,
|
LogDir: defaultLogDir,
|
||||||
PeerPort: defaultPeerPort,
|
PeerPort: defaultPeerPort,
|
||||||
RPCPort: defaultRPCPort,
|
RPCPort: defaultRPCPort,
|
||||||
RESTPort: defaultRESTPort,
|
RESTPort: defaultRESTPort,
|
||||||
MaxPendingChannels: defaultMaxPendingChannels,
|
MaxPendingChannels: defaultMaxPendingChannels,
|
||||||
|
DefaultNumChanConfs: defaultNumChanConfs,
|
||||||
Bitcoin: &chainConfig{
|
Bitcoin: &chainConfig{
|
||||||
RPCHost: defaultRPCHost,
|
RPCHost: defaultRPCHost,
|
||||||
RPCCert: defaultBtcdRPCCertFile,
|
RPCCert: defaultBtcdRPCCertFile,
|
||||||
|
2
lnd.go
2
lnd.go
@ -162,7 +162,7 @@ func lndMain() error {
|
|||||||
// TODO(roasbeef): add configurable mapping
|
// TODO(roasbeef): add configurable mapping
|
||||||
// * simple switch initially
|
// * simple switch initially
|
||||||
// * assign coefficient, etc
|
// * assign coefficient, etc
|
||||||
return 1
|
return uint16(cfg.DefaultNumChanConfs)
|
||||||
},
|
},
|
||||||
RequiredRemoteDelay: func(chanAmt btcutil.Amount) uint16 {
|
RequiredRemoteDelay: func(chanAmt btcutil.Amount) uint16 {
|
||||||
// TODO(roasbeef): add additional hooks for
|
// TODO(roasbeef): add additional hooks for
|
||||||
|
Loading…
Reference in New Issue
Block a user