diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2019-01-09 15:31:32 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2019-01-09 15:31:51 +0100 |
commit | 195d28fecb2dfbe02f89056d42ef60679010fff5 (patch) | |
tree | 9f0861fdf00043de4b6e13bece8bbe873e941997 | |
parent | ff7f7364d6a244c78adc5575a0ad03a743b5dad9 (diff) | |
parent | ba8c8b22272ad40fe2de465d7e745532bab48d3b (diff) |
Merge #15124: Fail AppInitMain if either disk space check fails
ba8c8b22272ad40fe2de465d7e745532bab48d3b Fail if either disk space check fails (Ben Woosley)
Pull request description:
Rather than both.
Introduced in 386a6b62a8a1db9dd0f354cb95b7585f555c7e5d, #12653
Tree-SHA512: 24765dd3c62b742c491d7d9a751917c2ce6f3819a8764a7725ce84910ef69bffca07f4c0dfbeed8c4f978a12c4b04a2ac3b8c2ff59602330a8a3e8a68878c41b
-rw-r--r-- | src/init.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp index 18c145a023..f4f00ea691 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1631,8 +1631,14 @@ bool AppInitMain(InitInterfaces& interfaces) // ********************************************************* Step 11: import blocks - if (!CheckDiskSpace() && !CheckDiskSpace(0, true)) + if (!CheckDiskSpace(/* additional_bytes */ 0, /* blocks_dir */ false)) { + InitError(strprintf(_("Error: Disk space is low for %s"), GetDataDir())); return false; + } + if (!CheckDiskSpace(/* additional_bytes */ 0, /* blocks_dir */ true)) { + InitError(strprintf(_("Error: Disk space is low for %s"), GetBlocksDir())); + return false; + } // Either install a handler to notify us when genesis activates, or set fHaveGenesis directly. // No locking, as this happens before any background thread is started. |