def clean_cache_subdir(cachedir):
    os.remove(os.path.join(get_datadir_path(cachedir, 0), '.incomplete'))

    def cache_path(n, *paths):
        return os.path.join(get_datadir_path(cachedir, n), 'regtest', *paths)
    for i in range(MAX_NODES):
        for entry in os.listdir(cache_path(i)):
            if (entry not in ['wallet.dat', 'chainstate', 'blocks', 'sporks', 'backups']):
                os.remove(cache_path(i, entry))
def clean_cache_subdir(cachedir):
    os.remove(os.path.join(get_datadir_path(cachedir, 0), '.incomplete'))

    def cache_path(n, *paths):
        return os.path.join(get_datadir_path(cachedir, n), 'regtest', *paths)
    for i in range(MAX_NODES):
        for entry in os.listdir(cache_path(i)):
            if (entry not in ['wallet.dat', 'chainstate', 'blocks', 'sporks', 'backups']):
                os.remove(cache_path(i, entry))