From b213402722bd0eaa380cc43d4b1d5f7104efeaac Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Tue, 1 Jun 2021 16:20:58 -0700 Subject: [PATCH 1/2] config: support auto rpc config with bitcoind signet This allows lnd to automatically retrieve the RPC credentials when attempting to connect to a signet bitcoind node. --- config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.go b/config.go index 5c8467e2..26b109b4 100644 --- a/config.go +++ b/config.go @@ -1756,7 +1756,7 @@ func extractBitcoindRPCParams(networkName string, switch networkName { case "mainnet": chainDir = "" - case "regtest", "testnet3": + case "regtest", "testnet3", "signet": chainDir = networkName default: return "", "", "", "", fmt.Errorf("unexpected networkname %v", networkName) From 0bd6f32867e221eaa48664ab356b33344dd25220 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Tue, 1 Jun 2021 16:21:31 -0700 Subject: [PATCH 2/2] chainreg: handle missing case for bitcoind signet rpc connectivity This allows lnd to connect to bitcoind's expected signet RPC port. --- chainreg/chainregistry.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chainreg/chainregistry.go b/chainreg/chainregistry.go index af8eb932..459dae15 100644 --- a/chainreg/chainregistry.go +++ b/chainreg/chainregistry.go @@ -378,8 +378,10 @@ func NewChainControl(cfg *Config, blockCache *blockcache.BlockCache) ( rpcPort -= 2 bitcoindHost = fmt.Sprintf("%v:%d", bitcoindMode.RPCHost, rpcPort) - if (cfg.Bitcoin.Active && cfg.Bitcoin.RegTest) || + if (cfg.Bitcoin.Active && + (cfg.Bitcoin.RegTest || cfg.Bitcoin.SigNet)) || (cfg.Litecoin.Active && cfg.Litecoin.RegTest) { + conn, err := net.Dial("tcp", bitcoindHost) if err != nil || conn == nil { switch {