Skip to content

Commit

Permalink
Merge #11747: Fix: Open files read only if requested
Browse files Browse the repository at this point in the history
e1a8ec5 Fix: Open files read only if requested (Andras Elso)

Tree-SHA512: 047951bf3fa1272764596d2efed0a541105a6d3057789ba4218cd1bbce8a802cab0feac0ed3d28f6eab6b2e54e294d46f729dd0162d6d209e319d716c0567352
  • Loading branch information
laanwj committed Nov 29, 2017
2 parents 26efc22 + e1a8ec5 commit e970396
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/validation.cpp
Expand Up @@ -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) {
Expand Down

0 comments on commit e970396

Please sign in to comment.