mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-02 05:27:17 +00:00
Tighten the exception SPVBlockStore throws when the chain file is locked.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package org.bitcoinj.store;
|
||||
|
||||
/**
|
||||
* Thrown by {@link SPVBlockStore} when the process cannot gain exclusive access to the chain file.
|
||||
*/
|
||||
public class ChainFileLockedException extends BlockStoreException {
|
||||
public ChainFileLockedException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public ChainFileLockedException(Throwable t) {
|
||||
super(t);
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,7 @@ public class SPVBlockStore implements BlockStore {
|
||||
FileChannel channel = randomAccessFile.getChannel();
|
||||
fileLock = channel.tryLock();
|
||||
if (fileLock == null)
|
||||
throw new BlockStoreException("Store file is already locked by another process");
|
||||
throw new ChainFileLockedException("Store file is already locked by another process");
|
||||
|
||||
// Map it into memory read/write. The kernel will take care of flushing writes to disk at the most
|
||||
// efficient times, which may mean that until the map is deallocated the data on disk is randomly
|
||||
|
||||
Reference in New Issue
Block a user