From 4b348c1d33373d672edd83fc576892d0e46686d2 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 22 Mar 2017 12:48:02 -0600 Subject: [PATCH] rpctest: Add P2PAddress() for Harness to get P2P listen address --- rpctest/rpc_harness.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rpctest/rpc_harness.go b/rpctest/rpc_harness.go index 7d1b5f7c..16ba96d4 100644 --- a/rpctest/rpc_harness.go +++ b/rpctest/rpc_harness.go @@ -383,6 +383,13 @@ func (h *Harness) RPCConfig() btcrpcclient.ConnConfig { return h.node.config.rpcConnConfig() } +// P2PAddress returns the harness' P2P listening address. This allows potential +// peers (such as SPV peers) created within tests to connect to a given test +// harness instance. +func (h *Harness) P2PAddress() string { + return h.node.config.listen +} + // GenerateAndSubmitBlock creates a block whose contents include the passed // transactions and submits it to the running simnet node. For generating // blocks with only a coinbase tx, callers can simply pass nil instead of