|
|
@ -35,10 +35,8 @@ class RPCBindTest(BitcoinTestFramework): |
|
|
|
base_args += ['-rpcallowip=' + x for x in allow_ips] |
|
|
|
base_args += ['-rpcallowip=' + x for x in allow_ips] |
|
|
|
binds = ['-rpcbind='+addr for addr in addresses] |
|
|
|
binds = ['-rpcbind='+addr for addr in addresses] |
|
|
|
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, [base_args + binds], connect_to) |
|
|
|
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, [base_args + binds], connect_to) |
|
|
|
try: |
|
|
|
|
|
|
|
pid = bitcoind_processes[0].pid |
|
|
|
pid = bitcoind_processes[0].pid |
|
|
|
assert_equal(set(get_bind_addrs(pid)), set(expected)) |
|
|
|
assert_equal(set(get_bind_addrs(pid)), set(expected)) |
|
|
|
finally: |
|
|
|
|
|
|
|
stop_nodes(self.nodes) |
|
|
|
stop_nodes(self.nodes) |
|
|
|
|
|
|
|
|
|
|
|
def run_allowip_test(self, allow_ips, rpchost, rpcport): |
|
|
|
def run_allowip_test(self, allow_ips, rpchost, rpcport): |
|
|
@ -48,12 +46,9 @@ class RPCBindTest(BitcoinTestFramework): |
|
|
|
''' |
|
|
|
''' |
|
|
|
base_args = ['-disablewallet', '-nolisten'] + ['-rpcallowip='+x for x in allow_ips] |
|
|
|
base_args = ['-disablewallet', '-nolisten'] + ['-rpcallowip='+x for x in allow_ips] |
|
|
|
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, [base_args]) |
|
|
|
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, [base_args]) |
|
|
|
try: |
|
|
|
|
|
|
|
# connect to node through non-loopback interface |
|
|
|
# connect to node through non-loopback interface |
|
|
|
node = get_rpc_proxy(rpc_url(0, "%s:%d" % (rpchost, rpcport)), 0) |
|
|
|
node = get_rpc_proxy(rpc_url(0, "%s:%d" % (rpchost, rpcport)), 0) |
|
|
|
node.getnetworkinfo() |
|
|
|
node.getnetworkinfo() |
|
|
|
finally: |
|
|
|
|
|
|
|
node = None # make sure connection will be garbage collected and closed |
|
|
|
|
|
|
|
stop_nodes(self.nodes) |
|
|
|
stop_nodes(self.nodes) |
|
|
|
|
|
|
|
|
|
|
|
def run_test(self): |
|
|
|
def run_test(self): |
|
|
|