config+pilot: add flag to specify min confs for autopilot agent

This commit is contained in:
Wilmer Paulino committed 2018-08-16 20:19:31 -07:00
1 parent ae3e66dccc
commit 7724d86801
2 files changed
+15 -5

No files matched your search

+7
View File
@@ -146,6 +146,7 @@ type autoPilotConfig struct {
MinChannelSize int64 `long:"minchansize" description:"The smallest channel that the autopilot agent should create"`
MaxChannelSize int64 `long:"maxchansize" description:"The largest channel that the autopilot agent should create"`
Private bool `long:"private" description:"Whether the channels created by the autopilot agent should be private or not. Private channels won't be announced to the network."`
MinConfs int32 `long:"minconfs" description:"The minimum number of confirmations each of your inputs in funding transactions created by the autopilot agent must have."`
}
type torConfig struct {
@@ -424,6 +425,12 @@ func loadConfig() (*config, error) {
fmt.Fprintln(os.Stderr, err)
return nil, err
}
if cfg.Autopilot.MinConfs < 0 {
str := "%s: autopilot.minconfs must be non-negative"
err := fmt.Errorf(str, funcName)
fmt.Fprintln(os.Stderr, err)
return nil, err
}
// Ensure that the specified values for the min and max channel size
// don't are within the bounds of the normal chan size constraints.