From ba8c8b22272ad40fe2de465d7e745532bab48d3b Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Mon, 7 Jan 2019 10:56:28 -0800 Subject: [PATCH] Fail if either disk space check fails Rather than both. Introduced in 386a6b62a8a1db9dd0f354cb95b7585f555c7e5d --- src/init.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index 18c145a02..f4f00ea69 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.