diff --git a/chainreg/chainregistry.go b/chainreg/chainregistry.go index c4a5caecd..f025dbb64 100644 --- a/chainreg/chainregistry.go +++ b/chainreg/chainregistry.go @@ -253,6 +253,8 @@ func GenDefaultBtcConstraints() channeldb.ChannelConstraints { // NewPartialChainControl creates a new partial chain control that contains all // the parts that can be purely constructed from the passed in global // configuration and doesn't need any wallet instance yet. +// +//nolint:lll func NewPartialChainControl(cfg *Config) (*PartialChainControl, func(), error) { // Set the RPC config from the "home" chain. Multi-chain isn't yet // active, so we'll restrict usage to a particular chain for now. @@ -414,14 +416,17 @@ func NewPartialChainControl(cfg *Config) (*PartialChainControl, func(), error) { if bitcoindMode.RPCPolling { bitcoindCfg.PollingConfig = &chain.PollingConfig{ - BlockPollingInterval: bitcoindMode.BlockPollingInterval, - TxPollingInterval: bitcoindMode.TxPollingInterval, + BlockPollingInterval: bitcoindMode.BlockPollingInterval, + TxPollingInterval: bitcoindMode.TxPollingInterval, + TxPollingIntervalJitter: lncfg.DefaultTxPollingJitter, } } else { bitcoindCfg.ZMQConfig = &chain.ZMQConfig{ - ZMQBlockHost: bitcoindMode.ZMQPubRawBlock, - ZMQTxHost: bitcoindMode.ZMQPubRawTx, - ZMQReadDeadline: bitcoindMode.ZMQReadDeadline, + ZMQBlockHost: bitcoindMode.ZMQPubRawBlock, + ZMQTxHost: bitcoindMode.ZMQPubRawTx, + ZMQReadDeadline: bitcoindMode.ZMQReadDeadline, + MempoolPollingInterval: bitcoindMode.TxPollingInterval, + PollingIntervalJitter: lncfg.DefaultTxPollingJitter, } } diff --git a/lncfg/bitcoind.go b/lncfg/bitcoind.go index a54aefa27..b574aef16 100644 --- a/lncfg/bitcoind.go +++ b/lncfg/bitcoind.go @@ -2,6 +2,12 @@ package lncfg import "time" +const ( + // DefaultTxPollingJitter defines the default TxPollingIntervalJitter + // to be used for bitcoind backend. + DefaultTxPollingJitter = 0.5 +) + // Bitcoind holds the configuration options for the daemon's connection to // bitcoind. //