diff options
| author | Andras Elso <[email protected]> | 2017-11-21 20:35:06 +0100 |
|---|---|---|
| committer | Andras Elso <[email protected]> | 2017-11-21 20:35:06 +0100 |
| commit | e1a8ec56c56161be15af1c33067918959e2666de (patch) | |
| tree | 5f69cb6b043958e55059a2ddad1a78bc070c99ff /src/validation.cpp | |
| parent | Merge #11738: Fix sendrawtransaction hang when sending a tx already in mempool (diff) | |
| download | discoin-e1a8ec56c56161be15af1c33067918959e2666de.tar.xz discoin-e1a8ec56c56161be15af1c33067918959e2666de.zip | |
Fix: Open files read only if requested
Diffstat (limited to 'src/validation.cpp')
| -rw-r--r-- | src/validation.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 99ea1433f..9d45ef5f8 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) { |