mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-04 18:01:57 +01:00
multi: use uptime api for bitcoind healthcheck if version > 0.15
The getblockchaininfo call in bitcoind uses a commonly used lock, csmain, in bitcoind. This made the endpoint unsuitable for a health check, because some nodes were seeing waits up to 5 minutes (!). This commit updates our health check function to use the uptime api, provided our bitcoind version is > 0.15, when the api was added. We do not need to switch our health check for btcd, because it has more granular locking.
This commit is contained in:
@@ -1292,10 +1292,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
// will not run it.
|
||||
chainHealthCheck := healthcheck.NewObservation(
|
||||
"chain backend",
|
||||
func() error {
|
||||
_, _, err := cc.ChainIO.GetBestBlock()
|
||||
return err
|
||||
},
|
||||
cc.HealthCheck,
|
||||
cfg.HealthChecks.ChainCheck.Interval,
|
||||
cfg.HealthChecks.ChainCheck.Timeout,
|
||||
cfg.HealthChecks.ChainCheck.Backoff,
|
||||
|
||||
Reference in New Issue
Block a user