Throw BlockStoreException if the chain head doesn't seem to be in the store. Update issue 66.

This commit is contained in:
Mike Hearn 2011-08-05 14:09:48 +00:00
parent 94f36ae8ec
commit 4e097c1e80

View File

@ -268,7 +268,10 @@ public class BoundedOverheadBlockStore implements BlockStore {
}
public synchronized StoredBlock getChainHead() throws BlockStoreException {
return get(chainHead);
StoredBlock head = get(chainHead);
if (head == null)
throw new BlockStoreException("Corrupted block store: chain head not found");
return head;
}
public synchronized void setChainHead(StoredBlock chainHead) throws BlockStoreException {