From 966ae00fe4b7c8420b6a1cfe3aa30fca4410a0e8 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 14 May 2012 07:49:17 +0200 Subject: [PATCH] make CheckDiskSpace() use a global static const uint64 for checking required disk space and remove 2 ugly spaces from a message string --- src/main.cpp | 6 +++--- src/main.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 20bb56e9..bd51fe30 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1845,11 +1845,11 @@ bool CheckDiskSpace(uint64 nAdditionalBytes) { uint64 nFreeBytesAvailable = filesystem::space(GetDataDir()).available; - // Check for 15MB because database could create another 10MB log file at any time - if (nFreeBytesAvailable < (uint64)15000000 + nAdditionalBytes) + // Check for nMinDiskSpace bytes (currently 50MB) + if (nFreeBytesAvailable < nMinDiskSpace + nAdditionalBytes) { fShutdown = true; - string strMessage = _("Warning: Disk space is low "); + string strMessage = _("Warning: Disk space is low"); strMiscWarning = strMessage; printf("*** %s\n", strMessage.c_str()); ThreadSafeMessageBox(strMessage, "Bitcoin", wxOK | wxICON_EXCLAMATION | wxMODAL); diff --git a/src/main.h b/src/main.h index 5ac5547a..1fa2308b 100644 --- a/src/main.h +++ b/src/main.h @@ -75,8 +75,8 @@ extern unsigned char pchMessageStart[4]; // Settings extern int64 nTransactionFee; - - +// Minimum disk space required - used in CheckDiskSpace() +static const uint64 nMinDiskSpace = 52428800; class CReserveKey;