Fail if either disk space check fails

Rather than both.

Introduced in 386a6b62a8
This commit is contained in:
Ben Woosley 2019-01-07 10:56:28 -08:00
parent 1973257da0
commit ba8c8b2227
No known key found for this signature in database
GPG key ID: 4D8CA4BA18040906

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.