Skip to content
This repository was archived by the owner on Aug 23, 2020. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,19 @@ private Snapshot loadLocalSnapshot() throws SnapshotException, SpentAddressesExc
}

private void assertSpentAddressesDbExist() throws SpentAddressesException {
String spentAddressesDbPath = config.getSpentAddressesDbPath();
try {
File spentAddressFolder = new File(SnapshotConfig.Descriptions.SPENT_ADDRESSES_DB_LOG_PATH);
File spentAddressFolder = new File(spentAddressesDbPath);
//If there is at least one file in the db the check should pass
if (Files.newDirectoryStream(spentAddressFolder.toPath(), "*.sst").iterator().hasNext()) {
return;
}
}
catch (IOException e){
throw new SpentAddressesException("Can't load " + SnapshotConfig.Descriptions.SPENT_ADDRESSES_DB_LOG_PATH + " folder", e);
throw new SpentAddressesException("Can't load " + spentAddressesDbPath + " folder", e);
}

throw new SpentAddressesException(SnapshotConfig.Descriptions.SPENT_ADDRESSES_DB_LOG_PATH + " folder has no sst files");
throw new SpentAddressesException(spentAddressesDbPath + " folder has no sst files");
}

/**
Expand Down