|
|
|
@ -88,8 +88,12 @@ def initialize_chain(test_dir):
@@ -88,8 +88,12 @@ def initialize_chain(test_dir):
|
|
|
|
|
if i > 0: |
|
|
|
|
args.append("-connect=127.0.0.1:"+str(p2p_port(0))) |
|
|
|
|
bitcoind_processes[i] = subprocess.Popen(args) |
|
|
|
|
if os.getenv("PYTHON_DEBUG", ""): |
|
|
|
|
print "initialize_chain: bitcoind started, calling bitcoin-cli -rpcwait getblockcount" |
|
|
|
|
subprocess.check_call([ os.getenv("BITCOINCLI", "bitcoin-cli"), "-datadir="+datadir, |
|
|
|
|
"-rpcwait", "getblockcount"], stdout=devnull) |
|
|
|
|
if os.getenv("PYTHON_DEBUG", ""): |
|
|
|
|
print "initialize_chain: bitcoin-cli -rpcwait getblockcount completed" |
|
|
|
|
devnull.close() |
|
|
|
|
rpcs = [] |
|
|
|
|
for i in range(4): |
|
|
|
@ -169,9 +173,13 @@ def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary=
@@ -169,9 +173,13 @@ def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary=
|
|
|
|
|
if extra_args is not None: args.extend(extra_args) |
|
|
|
|
bitcoind_processes[i] = subprocess.Popen(args) |
|
|
|
|
devnull = open("/dev/null", "w+") |
|
|
|
|
if os.getenv("PYTHON_DEBUG", ""): |
|
|
|
|
print "start_node: bitcoind started, calling bitcoin-cli -rpcwait getblockcount" |
|
|
|
|
subprocess.check_call([ os.getenv("BITCOINCLI", "bitcoin-cli"), "-datadir="+datadir] + |
|
|
|
|
_rpchost_to_args(rpchost) + |
|
|
|
|
["-rpcwait", "getblockcount"], stdout=devnull) |
|
|
|
|
if os.getenv("PYTHON_DEBUG", ""): |
|
|
|
|
print "start_node: calling bitcoin-cli -rpcwait getblockcount returned" |
|
|
|
|
devnull.close() |
|
|
|
|
url = "http://rt:rt@%s:%d" % (rpchost or '127.0.0.1', rpc_port(i)) |
|
|
|
|
if timewait is not None: |
|
|
|
|