Skip to content

Commit 195d28f

Browse files
committed
Merge #15124: Fail AppInitMain if either disk space check fails
ba8c8b2 Fail if either disk space check fails (Ben Woosley) Pull request description: Rather than both. Introduced in 386a6b6, #12653 Tree-SHA512: 24765dd3c62b742c491d7d9a751917c2ce6f3819a8764a7725ce84910ef69bffca07f4c0dfbeed8c4f978a12c4b04a2ac3b8c2ff59602330a8a3e8a68878c41b
2 parents ff7f736 + ba8c8b2 commit 195d28f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/init.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1631,8 +1631,14 @@ bool AppInitMain(InitInterfaces& interfaces)
16311631

16321632
// ********************************************************* Step 11: import blocks
16331633

1634-
if (!CheckDiskSpace() && !CheckDiskSpace(0, true))
1634+
if (!CheckDiskSpace(/* additional_bytes */ 0, /* blocks_dir */ false)) {
1635+
InitError(strprintf(_("Error: Disk space is low for %s"), GetDataDir()));
16351636
return false;
1637+
}
1638+
if (!CheckDiskSpace(/* additional_bytes */ 0, /* blocks_dir */ true)) {
1639+
InitError(strprintf(_("Error: Disk space is low for %s"), GetBlocksDir()));
1640+
return false;
1641+
}
16361642

16371643
// Either install a handler to notify us when genesis activates, or set fHaveGenesis directly.
16381644
// No locking, as this happens before any background thread is started.

0 commit comments

Comments
 (0)