diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1196,23 +1196,30 @@ /** Abort with a message */ static bool AbortNode(const std::string &strMessage, - const std::string &userMessage = "") { + const std::string &userMessage = "", + unsigned int prefix = 0) { SetMiscWarning(strMessage); LogPrintf("*** %s\n", strMessage); - uiInterface.ThreadSafeMessageBox( - userMessage.empty() ? _("Error: A fatal internal error occurred, see " - "debug.log for details") - .translated - : userMessage, - "", CClientUIInterface::MSG_ERROR); + if (!userMessage.empty()) { + uiInterface.ThreadSafeMessageBox( + userMessage, "", CClientUIInterface::MSG_ERROR | prefix); + } else { + uiInterface.ThreadSafeMessageBox( + _("Error: A fatal internal error occurred, see debug.log for " + "details") + .translated, + "", + CClientUIInterface::MSG_ERROR | CClientUIInterface::MSG_NOPREFIX); + } StartShutdown(); return false; } static bool AbortNode(BlockValidationState &state, const std::string &strMessage, - const std::string &userMessage = "") { - AbortNode(strMessage, userMessage); + const std::string &userMessage = "", + unsigned int prefix = 0) { + AbortNode(strMessage, userMessage, prefix); return state.Error(strMessage); } @@ -1928,8 +1935,10 @@ if (fDoFullFlush || fPeriodicWrite) { // Depend on nMinDiskSpace to ensure we can write block index if (!CheckDiskSpace(GetBlocksDir())) { - return AbortNode(state, "Disk space is low!", - _("Error: Disk space is low!").translated); + return AbortNode( + state, "Disk space is too low!", + _("Error: Disk space is too low!").translated, + CClientUIInterface::MSG_NOPREFIX); } // First make sure all block and undo data is flushed to disk. @@ -1977,8 +1986,10 @@ // factor of 2. if (!CheckDiskSpace(GetDataDir(), 48 * 2 * 2 * pcoinsTip->GetCacheSize())) { - return AbortNode(state, "Disk space is low!", - _("Error: Disk space is low!").translated); + return AbortNode( + state, "Disk space is too low!", + _("Error: Disk space is too low!").translated, + CClientUIInterface::MSG_NOPREFIX); } // Flush the chainstate (which may refer to block index @@ -3339,8 +3350,9 @@ size_t bytes_allocated = BlockFileSeq().Allocate(pos, nAddSize, out_of_space); if (out_of_space) { - return AbortNode("Disk space is low!", - _("Error: Disk space is low!").translated); + return AbortNode("Disk space is too low!", + _("Error: Disk space is too low!").translated, + CClientUIInterface::MSG_NOPREFIX); } if (bytes_allocated != 0 && fPruneMode) { fCheckForPruning = true; @@ -3365,8 +3377,9 @@ size_t bytes_allocated = UndoFileSeq().Allocate(pos, nAddSize, out_of_space); if (out_of_space) { - return AbortNode(state, "Disk space is low!", - _("Error: Disk space is low!").translated); + return AbortNode(state, "Disk space is too low!", + _("Error: Disk space is too low!").translated, + CClientUIInterface::MSG_NOPREFIX); } if (bytes_allocated != 0 && fPruneMode) { fCheckForPruning = true;