diff --git a/chainreg/chainregistry.go b/chainreg/chainregistry.go index 31519419..246876d4 100644 --- a/chainreg/chainregistry.go +++ b/chainreg/chainregistry.go @@ -397,6 +397,7 @@ func NewChainControl(cfg *Config) (*ChainControl, error) { ZMQTxHost: bitcoindMode.ZMQPubRawTx, ZMQReadDeadline: 5 * time.Second, Dialer: cfg.Dialer, + PrunedModeMaxPeers: bitcoindMode.PrunedNodeMaxPeers, }) if err != nil { return nil, err diff --git a/config.go b/config.go index be22891d..cdc4ca74 100644 --- a/config.go +++ b/config.go @@ -183,6 +183,8 @@ var ( defaultBitcoindEstimateMode = "CONSERVATIVE" bitcoindEstimateModes = [2]string{"ECONOMICAL", defaultBitcoindEstimateMode} + defaultPrunedNodeMaxPeers = 4 + defaultSphinxDbName = "sphinxreplay.db" ) @@ -392,9 +394,10 @@ func DefaultConfig() Config { RPCCert: defaultBtcdRPCCertFile, }, BitcoindMode: &lncfg.Bitcoind{ - Dir: defaultBitcoindDir, - RPCHost: defaultRPCHost, - EstimateMode: defaultBitcoindEstimateMode, + Dir: defaultBitcoindDir, + RPCHost: defaultRPCHost, + EstimateMode: defaultBitcoindEstimateMode, + PrunedNodeMaxPeers: defaultPrunedNodeMaxPeers, }, Litecoin: &lncfg.Chain{ MinHTLCIn: chainreg.DefaultLitecoinMinHTLCInMSat, @@ -411,9 +414,10 @@ func DefaultConfig() Config { RPCCert: defaultLtcdRPCCertFile, }, LitecoindMode: &lncfg.Bitcoind{ - Dir: defaultLitecoindDir, - RPCHost: defaultRPCHost, - EstimateMode: defaultBitcoindEstimateMode, + Dir: defaultLitecoindDir, + RPCHost: defaultRPCHost, + EstimateMode: defaultBitcoindEstimateMode, + PrunedNodeMaxPeers: defaultPrunedNodeMaxPeers, }, NeutrinoMode: &lncfg.Neutrino{ UserAgentName: neutrino.UserAgentName, diff --git a/lncfg/bitcoind.go b/lncfg/bitcoind.go index 6076a3b1..40bbcd8e 100644 --- a/lncfg/bitcoind.go +++ b/lncfg/bitcoind.go @@ -3,11 +3,12 @@ package lncfg // Bitcoind holds the configuration options for the daemon's connection to // bitcoind. type Bitcoind struct { - Dir string `long:"dir" description:"The base directory that contains the node's data, logs, configuration file, etc."` - RPCHost string `long:"rpchost" description:"The daemon's rpc listening address. If a port is omitted, then the default port for the selected chain parameters will be used."` - RPCUser string `long:"rpcuser" description:"Username for RPC connections"` - RPCPass string `long:"rpcpass" default-mask:"-" description:"Password for RPC connections"` - ZMQPubRawBlock string `long:"zmqpubrawblock" description:"The address listening for ZMQ connections to deliver raw block notifications"` - ZMQPubRawTx string `long:"zmqpubrawtx" description:"The address listening for ZMQ connections to deliver raw transaction notifications"` - EstimateMode string `long:"estimatemode" description:"The fee estimate mode. Must be either ECONOMICAL or CONSERVATIVE."` + Dir string `long:"dir" description:"The base directory that contains the node's data, logs, configuration file, etc."` + RPCHost string `long:"rpchost" description:"The daemon's rpc listening address. If a port is omitted, then the default port for the selected chain parameters will be used."` + RPCUser string `long:"rpcuser" description:"Username for RPC connections"` + RPCPass string `long:"rpcpass" default-mask:"-" description:"Password for RPC connections"` + ZMQPubRawBlock string `long:"zmqpubrawblock" description:"The address listening for ZMQ connections to deliver raw block notifications"` + ZMQPubRawTx string `long:"zmqpubrawtx" description:"The address listening for ZMQ connections to deliver raw transaction notifications"` + EstimateMode string `long:"estimatemode" description:"The fee estimate mode. Must be either ECONOMICAL or CONSERVATIVE."` + PrunedNodeMaxPeers int `long:"pruned-node-max-peers" description:"The maximum number of peers lnd will choose from the backend node to retrieve pruned blocks from. This only applies to pruned nodes."` } diff --git a/sample-lnd.conf b/sample-lnd.conf index 50ee6433..f9bee948 100644 --- a/sample-lnd.conf +++ b/sample-lnd.conf @@ -536,6 +536,10 @@ bitcoin.node=btcd ; If unset, the default value is "CONSERVATIVE". ; bitcoind.estimatemode=CONSERVATIVE +; The maximum number of peers lnd will choose from the backend node to retrieve +; pruned blocks from. This only applies to pruned nodes. +; bitcoind.pruned-node-max-peers=4 + [neutrino] ; Connect only to the specified peers at startup. This creates a persistent @@ -706,6 +710,10 @@ litecoin.node=ltcd ; If unset, the default value is "CONSERVATIVE". ; litecoind.estimatemode=CONSERVATIVE +; The maximum number of peers lnd will choose from the backend node to retrieve +; pruned blocks from. This only applies to pruned nodes. +; litecoind.pruned-node-max-peers=4 + [autopilot] ; If the autopilot agent should be active or not. The autopilot agent will