3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 14:54:15 +00:00

Use a slightly more sensible startup sequence for BoundedOverheadBlockStore to avoid log spam when creating a fresh chain.

This commit is contained in:
Mike Hearn 2012-02-10 15:45:43 +01:00
parent 96a1e87f47
commit 781cb1f8d5

View File

@ -144,12 +144,17 @@ public class BoundedOverheadBlockStore implements BlockStore {
public BoundedOverheadBlockStore(NetworkParameters params, File file) throws BlockStoreException { public BoundedOverheadBlockStore(NetworkParameters params, File file) throws BlockStoreException {
this.params = params; this.params = params;
try { if (file.exists()) {
load(file); try {
} catch (Exception e) { load(file);
log.error("failed to load block store from file", e); return;
createNewStore(params, file); } catch (Exception e) {
log.error("Failed to load block chain from " + file, e);
// Fall through and try to create a new one.
}
} }
createNewStore(params, file);
} }
private void createNewStore(NetworkParameters params, File file) throws BlockStoreException { private void createNewStore(NetworkParameters params, File file) throws BlockStoreException {