mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-20 10:12:19 +01:00
Throw BlockStoreException if the chain head doesn't seem to be in the store. Update issue 66.
This commit is contained in:
parent
94f36ae8ec
commit
4e097c1e80
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user