chainreg: update bitcoind polling config

This commit is contained in:
yyforyongyu 2023-04-19 01:18:04 +08:00
parent d5db1950cd
commit 66d1392f7f
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868
2 changed files with 16 additions and 5 deletions

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.
@ -416,12 +418,15 @@ func NewPartialChainControl(cfg *Config) (*PartialChainControl, func(), error) {
bitcoindCfg.PollingConfig = &chain.PollingConfig{
BlockPollingInterval: bitcoindMode.BlockPollingInterval,
TxPollingInterval: bitcoindMode.TxPollingInterval,
TxPollingIntervalJitter: lncfg.DefaultTxPollingJitter,
}
} else {
bitcoindCfg.ZMQConfig = &chain.ZMQConfig{
ZMQBlockHost: bitcoindMode.ZMQPubRawBlock,
ZMQTxHost: bitcoindMode.ZMQPubRawTx,
ZMQReadDeadline: bitcoindMode.ZMQReadDeadline,
MempoolPollingInterval: bitcoindMode.TxPollingInterval,
PollingIntervalJitter: lncfg.DefaultTxPollingJitter,
}
}

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.
//