Skip to content

Commit

Permalink
Merge pull request zcash#5139
Browse files Browse the repository at this point in the history
9f87325 Start with tidier cache directories (Gavin Andresen)

Signed-off-by: Gavin Andresen <[email protected]>
  • Loading branch information
gavinandresen committed Oct 27, 2014
2 parents b6c99ef + 9f87325 commit e4f79c0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions qa/rpc-tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,14 @@ def initialize_chain(test_dir):
rpcs[i].setgenerate(True, 25)
sync_blocks(rpcs)

# Shut them down, and remove debug.logs:
# Shut them down, and clean up cache directories:
stop_nodes(rpcs)
wait_bitcoinds()
for i in range(4):
os.remove(debug_log("cache", i))
os.remove(log_filename("cache", i, "debug.log"))
os.remove(log_filename("cache", i, "db.log"))
os.remove(log_filename("cache", i, "peers.dat"))
os.remove(log_filename("cache", i, "fee_estimates.dat"))

for i in range(4):
from_dir = os.path.join("cache", "node"+str(i))
Expand Down Expand Up @@ -167,8 +170,8 @@ def start_nodes(num_nodes, dir, extra_args=None, rpchost=None):
if extra_args is None: extra_args = [ None for i in range(num_nodes) ]
return [ start_node(i, dir, extra_args[i], rpchost) for i in range(num_nodes) ]

def debug_log(dir, n_node):
return os.path.join(dir, "node"+str(n_node), "regtest", "debug.log")
def log_filename(dir, n_node, logname):
return os.path.join(dir, "node"+str(n_node), "regtest", logname)

def stop_node(node, i):
node.stop()
Expand Down

0 comments on commit e4f79c0

Please sign in to comment.