@@ -65,6 +65,7 @@ def initialize_chain(test_dir):
65
65
"""
66
66
67
67
if not os .path .isdir (os .path .join ("cache" , "node0" )):
68
+ devnull = open ("/dev/null" , "w+" )
68
69
# Create cache directories, run bitcoinds:
69
70
for i in range (4 ):
70
71
datadir = os .path .join ("cache" , "node" + str (i ))
@@ -79,9 +80,9 @@ def initialize_chain(test_dir):
79
80
if i > 0 :
80
81
args .append ("-connect=127.0.0.1:" + str (START_P2P_PORT ))
81
82
bitcoind_processes .append (subprocess .Popen (args ))
82
- subprocess .check_output ([ "bitcoin-cli" , "-datadir=" + datadir ,
83
- "-rpcwait" , "getblockcount" ])
84
-
83
+ subprocess .check_call ([ "bitcoin-cli" , "-datadir=" + datadir ,
84
+ "-rpcwait" , "getblockcount" ], stdout = devnull )
85
+ devnull . close ()
85
86
rpcs = []
86
87
for i in range (4 ):
87
88
try :
@@ -113,12 +114,14 @@ def initialize_chain(test_dir):
113
114
114
115
def start_nodes (num_nodes , dir ):
115
116
# Start bitcoinds, and wait for RPC interface to be up and running:
117
+ devnull = open ("/dev/null" , "w+" )
116
118
for i in range (num_nodes ):
117
119
datadir = os .path .join (dir , "node" + str (i ))
118
120
args = [ "bitcoind" , "-datadir=" + datadir ]
119
121
bitcoind_processes .append (subprocess .Popen (args ))
120
- subprocess .check_output ([ "bitcoin-cli" , "-datadir=" + datadir ,
121
- "-rpcwait" , "getblockcount" ])
122
+ subprocess .check_call ([ "bitcoin-cli" , "-datadir=" + datadir ,
123
+ "-rpcwait" , "getblockcount" ], stdout = devnull )
124
+ devnull .close ()
122
125
# Create&return JSON-RPC connections
123
126
rpc_connections = []
124
127
for i in range (num_nodes ):
0 commit comments