multi: add health check for remote signer

This commit is contained in:
Oliver Gugger committed 2022-01-06 14:35:25 +01:00
1 parent 9601a9ab84
commit da59c1fa62
5 files changed
+86

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
package rpcwallet
import (
"fmt"
"time"
"github.com/lightningnetwork/lnd/lncfg"
)
// HealthCheck returns a health check function for the given remote signing
// configuration.
func HealthCheck(cfg *lncfg.RemoteSigner, timeout time.Duration) func() error {
return func() error {
_, err := connectRPC(
cfg.RPCHost, cfg.TLSCertPath, cfg.MacaroonPath, timeout,
)
if err != nil {
return fmt.Errorf("error connecting to the remote "+
"signing node through RPC: %v", err)
}
return nil
}
}