Merge #15124: Fail AppInitMain if either disk space check fails

ba8c8b2227 Fail if either disk space check fails (Ben Woosley)

Pull request description:

  Rather than both.

  Introduced in 386a6b62a8, #12653

Tree-SHA512: 24765dd3c62b742c491d7d9a751917c2ce6f3819a8764a7725ce84910ef69bffca07f4c0dfbeed8c4f978a12c4b04a2ac3b8c2ff59602330a8a3e8a68878c41b
This commit is contained in:
Wladimir J. van der Laan 2019-01-09 15:31:32 +01:00
commit 195d28fecb
No known key found for this signature in database
GPG key ID: 1E4AED62986CD25D

View file

@ -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.