chainreg: update bitcoind polling config

This commit is contained in:
yyforyongyu committed 2023-04-19 01:24:04 +08:00
1 parent d5db1950cd
commit 66d1392f7f
2 files changed
+16 -5

No files matched your search

+10 -5
View File
@@ -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,
}
}
+6
View File
@@ -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.
//