mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
Fix: Open files read only if requested
This commit is contained in:
parent
d4267a3ab2
commit
e1a8ec56c5
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user