Merge pull request #9257 from starius/estimatefeerate-regtest2

chainreg: use feerate estimator in regtest and simnet
This commit is contained in:
Oliver Gugger authored and GitHub committed 2024-12-03 18:56:50 +01:00
commit 48fba10562
2 files changed
+11 -6

No files matched your search

+6 -6
View File
@@ -385,8 +385,7 @@ func NewPartialChainControl(cfg *Config) (*PartialChainControl, func(), error) {
) )
cc.ChainSource = bitcoindConn.NewBitcoindClient() cc.ChainSource = bitcoindConn.NewBitcoindClient()
// If we're not in regtest mode, then we'll attempt to use a // Initialize config to connect to bitcoind RPC.
// proper fee estimator for testnet.
rpcConfig := &rpcclient.ConnConfig{ rpcConfig := &rpcclient.ConnConfig{
Host: bitcoindHost, Host: bitcoindHost,
User: bitcoindMode.RPCUser, User: bitcoindMode.RPCUser,
@@ -396,7 +395,9 @@ func NewPartialChainControl(cfg *Config) (*PartialChainControl, func(), error) {
DisableTLS: true, DisableTLS: true,
HTTPPostMode: true, HTTPPostMode: true,
} }
if !cfg.Bitcoin.RegTest {
// If feeurl is not provided, use bitcoind's fee estimator.
if cfg.Fee.URL == "" {
log.Infof("Initializing bitcoind backed fee estimator "+ log.Infof("Initializing bitcoind backed fee estimator "+
"in %s mode", bitcoindMode.EstimateMode) "in %s mode", bitcoindMode.EstimateMode)
@@ -660,9 +661,8 @@ func NewPartialChainControl(cfg *Config) (*PartialChainControl, func(), error) {
return checkOutboundPeers(chainRPC.Client) return checkOutboundPeers(chainRPC.Client)
} }
// If we're not in simnet or regtest mode, then we'll attempt // If feeurl is not provided, use btcd's fee estimator.
// to use a proper fee estimator for testnet. if cfg.Fee.URL == "" {
if !cfg.Bitcoin.SimNet && !cfg.Bitcoin.RegTest {
log.Info("Initializing btcd backed fee estimator") log.Info("Initializing btcd backed fee estimator")
// Finally, we'll re-initialize the fee estimator, as // Finally, we'll re-initialize the fee estimator, as
@@ -196,6 +196,11 @@ The underlying functionality between those two options remain the same.
for the Gossip 1.75 protocol. for the Gossip 1.75 protocol.
## Testing ## Testing
* LND [uses](https://github.com/lightningnetwork/lnd/pull/9257) the feerate
estimator provided by bitcoind or btcd in regtest and simnet modes instead of
static fee estimator if feeurl is not provided.
## Database ## Database
* [Migrate the mission control * [Migrate the mission control