Skip to content

Commit e970396

Browse files
committed
Merge #11747: Fix: Open files read only if requested
e1a8ec5 Fix: Open files read only if requested (Andras Elso) Tree-SHA512: 047951bf3fa1272764596d2efed0a541105a6d3057789ba4218cd1bbce8a802cab0feac0ed3d28f6eab6b2e54e294d46f729dd0162d6d209e319d716c0567352
2 parents 26efc22 + e1a8ec5 commit e970396

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/validation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3464,7 +3464,7 @@ static FILE* OpenDiskFile(const CDiskBlockPos &pos, const char *prefix, bool fRe
34643464
return nullptr;
34653465
fs::path path = GetBlockPosFilename(pos, prefix);
34663466
fs::create_directories(path.parent_path());
3467-
FILE* file = fsbridge::fopen(path, "rb+");
3467+
FILE* file = fsbridge::fopen(path, fReadOnly ? "rb": "rb+");
34683468
if (!file && !fReadOnly)
34693469
file = fsbridge::fopen(path, "wb+");
34703470
if (!file) {

0 commit comments

Comments
 (0)