diff --git a/contrib/pyln-testing/pyln/testing/utils.py b/contrib/pyln-testing/pyln/testing/utils.py index 32f94926c756..f62cfea5f32a 100644 --- a/contrib/pyln-testing/pyln/testing/utils.py +++ b/contrib/pyln-testing/pyln/testing/utils.py @@ -770,6 +770,7 @@ def __init__(self, node_id, lightning_dir, bitcoind, executor, valgrind, may_fai self.rc = 0 # Ensure we have an RPC we can use to talk to the node + self.grpc_port = options.get("grpc-port") if options else None self._create_rpc(jsonschemas) self.gossip_store = GossipStore(Path(lightning_dir, TEST_NETWORK, "gossip_store")) @@ -839,7 +840,7 @@ def _create_rpc(self, jsonschemas): def _create_grpc_rpc(self): from pyln.testing import grpc - self.grpc_port = reserve_unused_port() + self.grpc_port = self.grpc_port or reserve_unused_port() d = self.lightning_dir / TEST_NETWORK d.mkdir(parents=True, exist_ok=True) @@ -862,7 +863,6 @@ def _create_grpc_rpc(self): def _create_jsonrpc_rpc(self, jsonschemas): socket_path = self.lightning_dir / TEST_NETWORK / "lightning-rpc" - self.grpc_port = None self.rpc = PrettyPrintingLightningRpc( str(socket_path),