@@ -1374,20 +1374,22 @@ bool UndoReadFromDisk(CBlockUndo& blockundo, const CBlockIndex* pindex)
1374
1374
}
1375
1375
1376
1376
/* * Abort with a message */
1377
- static bool AbortNode (const std::string& strMessage, const std::string& userMessage= " " )
1377
+ static bool AbortNode (const std::string& strMessage, const std::string& userMessage = " " , unsigned int prefix = 0 )
1378
1378
{
1379
1379
SetMiscWarning (strMessage);
1380
1380
LogPrintf (" *** %s\n " , strMessage);
1381
- uiInterface.ThreadSafeMessageBox (
1382
- userMessage.empty () ? _ (" Error: A fatal internal error occurred, see debug.log for details" ) : userMessage,
1383
- " " , CClientUIInterface::MSG_ERROR);
1381
+ if (!userMessage.empty ()) {
1382
+ uiInterface.ThreadSafeMessageBox (userMessage, " " , CClientUIInterface::MSG_ERROR | prefix);
1383
+ } else {
1384
+ uiInterface.ThreadSafeMessageBox (_ (" Error: A fatal internal error occurred, see debug.log for details" ), " " , CClientUIInterface::MSG_ERROR | CClientUIInterface::MSG_NOPREFIX);
1385
+ }
1384
1386
StartShutdown ();
1385
1387
return false ;
1386
1388
}
1387
1389
1388
- static bool AbortNode (CValidationState& state, const std::string& strMessage, const std::string& userMessage= " " )
1390
+ static bool AbortNode (CValidationState& state, const std::string& strMessage, const std::string& userMessage = " " , unsigned int prefix = 0 )
1389
1391
{
1390
- AbortNode (strMessage, userMessage);
1392
+ AbortNode (strMessage, userMessage, prefix );
1391
1393
return state.Error (strMessage);
1392
1394
}
1393
1395
@@ -1998,7 +2000,7 @@ bool CChainState::FlushStateToDisk(
1998
2000
if (fDoFullFlush || fPeriodicWrite ) {
1999
2001
// Depend on nMinDiskSpace to ensure we can write block index
2000
2002
if (!CheckDiskSpace (GetBlocksDir ())) {
2001
- return AbortNode (state, " Disk space is low!" , _ (" Error: Disk space is low!" ));
2003
+ return AbortNode (state, " Disk space is too low!" , _ (" Error: Disk space is too low!" ), CClientUIInterface::MSG_NOPREFIX );
2002
2004
}
2003
2005
// First make sure all block and undo data is flushed to disk.
2004
2006
FlushBlockFile ();
@@ -2033,7 +2035,7 @@ bool CChainState::FlushStateToDisk(
2033
2035
// an overestimation, as most will delete an existing entry or
2034
2036
// overwrite one. Still, use a conservative safety factor of 2.
2035
2037
if (!CheckDiskSpace (GetDataDir (), 48 * 2 * 2 * pcoinsTip->GetCacheSize ())) {
2036
- return AbortNode (state, " Disk space is low!" , _ (" Error: Disk space is low!" ));
2038
+ return AbortNode (state, " Disk space is too low!" , _ (" Error: Disk space is too low!" ), CClientUIInterface::MSG_NOPREFIX );
2037
2039
}
2038
2040
// Flush the chainstate (which may refer to block index entries).
2039
2041
if (!pcoinsTip->Flush ())
@@ -2899,7 +2901,7 @@ static bool FindBlockPos(FlatFilePos &pos, unsigned int nAddSize, unsigned int n
2899
2901
bool out_of_space;
2900
2902
size_t bytes_allocated = BlockFileSeq ().Allocate (pos, nAddSize, out_of_space);
2901
2903
if (out_of_space) {
2902
- return AbortNode (" Disk space is low!" , _ (" Error: Disk space is low!" ));
2904
+ return AbortNode (" Disk space is too low!" , _ (" Error: Disk space is too low!" ), CClientUIInterface::MSG_NOPREFIX );
2903
2905
}
2904
2906
if (bytes_allocated != 0 && fPruneMode ) {
2905
2907
fCheckForPruning = true ;
@@ -2923,7 +2925,7 @@ static bool FindUndoPos(CValidationState &state, int nFile, FlatFilePos &pos, un
2923
2925
bool out_of_space;
2924
2926
size_t bytes_allocated = UndoFileSeq ().Allocate (pos, nAddSize, out_of_space);
2925
2927
if (out_of_space) {
2926
- return AbortNode (state, " Disk space is low!" , _ (" Error: Disk space is low!" ));
2928
+ return AbortNode (state, " Disk space is too low!" , _ (" Error: Disk space is too low!" ), CClientUIInterface::MSG_NOPREFIX );
2927
2929
}
2928
2930
if (bytes_allocated != 0 && fPruneMode ) {
2929
2931
fCheckForPruning = true ;
0 commit comments