aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndras Elso <elso.andras@gmail.com>2017-11-21 20:35:06 +0100
committerAndras Elso <elso.andras@gmail.com>2017-11-21 20:35:06 +0100
commite1a8ec56c56161be15af1c33067918959e2666de (patch)
tree5f69cb6b043958e55059a2ddad1a78bc070c99ff
parentd4267a3ab271d9affd3c1b0c2e30062490af804e (diff)
Fix: Open files read only if requested
-rw-r--r--src/validation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 99ea1433f9..9d45ef5f81 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -3464,7 +3464,7 @@ static FILE* OpenDiskFile(const CDiskBlockPos &pos, const char *prefix, bool fRe
return nullptr;
fs::path path = GetBlockPosFilename(pos, prefix);
fs::create_directories(path.parent_path());
- FILE* file = fsbridge::fopen(path, "rb+");
+ FILE* file = fsbridge::fopen(path, fReadOnly ? "rb": "rb+");
if (!file && !fReadOnly)
file = fsbridge::fopen(path, "wb+");
if (!file) {