lntest+lnd_test: add Connect and Disconnect miner for BackendCfgs

This commit gives the current chainbackend the ability to connect and
disconnect the chain backend at will. We do this to let the chain
backend initiate the connection to the miner, not the other way around.

This is a preparation for using Neutrino as a backend, as it only allows
making outbound connections.

We must also move the setup of the chainbackend to after to miner, to
know the address to connect to.
This commit is contained in:
Johan T. Halseth committed 2019-05-27 09:29:02 +02:00
1 parent 1788fa1566
commit aec00b1277
3 files changed
+41 -28

No files matched your search

+5 -3
View File
@@ -99,9 +99,11 @@ type BackendConfig interface {
// for using this node as a chain backend.
GenArgs() []string
// P2PAddr returns the address of this node to be used when connection
// over the Bitcoin P2P network.
P2PAddr() string
// ConnectMiner is called to establish a connection to the test miner.
ConnectMiner() error
// DisconnectMiner is called to bitconneeeect the miner.
DisconnectMiner() error
}
type nodeConfig struct {