mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-20 18:22:12 +01:00
Use "d" mode not "s" mode, to avoid needlessly updating file metadata (we don't use it).
This commit is contained in:
parent
c808ba89d2
commit
91fe7cdefb
@ -156,8 +156,8 @@ public class BoundedOverheadBlockStore implements BlockStore {
|
||||
if (!file.delete())
|
||||
throw new BlockStoreException("Could not delete old store in order to recreate it");
|
||||
}
|
||||
// Create fresh. The s stands for synchronous and ensures data is fsynced to disk at the right times.
|
||||
this.file = new RandomAccessFile(file, "rws");
|
||||
// Create fresh. The d makes writes synchronous.
|
||||
this.file = new RandomAccessFile(file, "rwd");
|
||||
this.channel = this.file.getChannel();
|
||||
this.file.write(FILE_FORMAT_VERSION);
|
||||
} catch (IOException e1) {
|
||||
@ -181,7 +181,7 @@ public class BoundedOverheadBlockStore implements BlockStore {
|
||||
private void load(File file) throws IOException, BlockStoreException {
|
||||
log.info("Reading block store from {}", file);
|
||||
// Open in synchronous mode. See above.
|
||||
this.file = new RandomAccessFile(file, "rws");
|
||||
this.file = new RandomAccessFile(file, "rwd");
|
||||
try {
|
||||
channel = this.file.getChannel();
|
||||
// Read a version byte.
|
||||
|
Loading…
Reference in New Issue
Block a user