mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-30 15:40:59 +02:00
Merge pull request #3177 from halseth/autopilot-targetconf-conf
[autopilot] make confirmation target configurable
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
|
||||
"github.com/btcsuite/btcutil"
|
||||
flags "github.com/jessevdk/go-flags"
|
||||
"github.com/lightningnetwork/lnd/autopilot"
|
||||
"github.com/lightningnetwork/lnd/build"
|
||||
"github.com/lightningnetwork/lnd/chanbackup"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
@@ -209,6 +210,7 @@ type autoPilotConfig struct {
|
||||
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."`
|
||||
ConfTarget uint32 `long:"conftarget" description:"The confirmation target (in blocks) for channels opened by autopilot."`
|
||||
}
|
||||
|
||||
type torConfig struct {
|
||||
@@ -389,6 +391,7 @@ func loadConfig() (*config, error) {
|
||||
Allocation: 0.6,
|
||||
MinChannelSize: int64(minChanFundingSize),
|
||||
MaxChannelSize: int64(MaxFundingAmount),
|
||||
ConfTarget: autopilot.DefaultConfTarget,
|
||||
Heuristic: map[string]float64{
|
||||
"preferential": 1.0,
|
||||
},
|
||||
@@ -559,6 +562,12 @@ func loadConfig() (*config, error) {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
return nil, err
|
||||
}
|
||||
if cfg.Autopilot.ConfTarget < 1 {
|
||||
str := "%s: autopilot.conftarget must be positive"
|
||||
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.
|
||||
|
Reference in New Issue
Block a user