mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-07-31 20:11:23 +00:00
Throw BlockStoreException if the chain head doesn't seem to be in the store. Update issue 66.
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user