Skip to content

Commit 083daf7

Browse files
committed
Pass bilingual_str argument to AbortNode()
1 parent d1cca12 commit 083daf7

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/validation.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,21 +1655,20 @@ bool UndoReadFromDisk(CBlockUndo& blockundo, const CBlockIndex* pindex)
16551655
}
16561656

16571657
/** Abort with a message */
1658-
// TODO: AbortNode() should take bilingual_str userMessage parameter.
1659-
static bool AbortNode(const std::string& strMessage, const std::string& userMessage = "", unsigned int prefix = 0)
1658+
static bool AbortNode(const std::string& strMessage, const bilingual_str& userMessage = bilingual_str(), unsigned int prefix = 0)
16601659
{
16611660
SetMiscWarning(strMessage);
16621661
LogPrintf("*** %s\n", strMessage);
16631662
if (!userMessage.empty()) {
1664-
uiInterface.ThreadSafeMessageBox(Untranslated(userMessage), "", CClientUIInterface::MSG_ERROR | prefix);
1663+
uiInterface.ThreadSafeMessageBox(userMessage, "", CClientUIInterface::MSG_ERROR | prefix);
16651664
} else {
16661665
uiInterface.ThreadSafeMessageBox(_("Error: A fatal internal error occurred, see debug.log for details"), "", CClientUIInterface::MSG_ERROR | CClientUIInterface::MSG_NOPREFIX);
16671666
}
16681667
StartShutdown();
16691668
return false;
16701669
}
16711670

1672-
static bool AbortNode(BlockValidationState& state, const std::string& strMessage, const std::string& userMessage = "", unsigned int prefix = 0)
1671+
static bool AbortNode(BlockValidationState& state, const std::string& strMessage, const bilingual_str& userMessage = bilingual_str(), unsigned int prefix = 0)
16731672
{
16741673
AbortNode(strMessage, userMessage, prefix);
16751674
return state.Error(strMessage);
@@ -2336,7 +2335,7 @@ bool CChainState::FlushStateToDisk(
23362335
if (fDoFullFlush || fPeriodicWrite) {
23372336
// Depend on nMinDiskSpace to ensure we can write block index
23382337
if (!CheckDiskSpace(GetBlocksDir())) {
2339-
return AbortNode(state, "Disk space is too low!", _("Error: Disk space is too low!").translated, CClientUIInterface::MSG_NOPREFIX);
2338+
return AbortNode(state, "Disk space is too low!", _("Error: Disk space is too low!"), CClientUIInterface::MSG_NOPREFIX);
23402339
}
23412340
{
23422341
LOG_TIME_MILLIS_WITH_CATEGORY("write block and undo data to disk", BCLog::BENCH);
@@ -2384,7 +2383,7 @@ bool CChainState::FlushStateToDisk(
23842383
// an overestimation, as most will delete an existing entry or
23852384
// overwrite one. Still, use a conservative safety factor of 2.
23862385
if (!CheckDiskSpace(GetDataDir(), 48 * 2 * 2 * CoinsTip().GetCacheSize())) {
2387-
return AbortNode(state, "Disk space is too low!", _("Error: Disk space is too low!").translated, CClientUIInterface::MSG_NOPREFIX);
2386+
return AbortNode(state, "Disk space is too low!", _("Error: Disk space is too low!"), CClientUIInterface::MSG_NOPREFIX);
23882387
}
23892388
// Flush the chainstate (which may refer to block index entries).
23902389
if (!CoinsTip().Flush())
@@ -3291,7 +3290,7 @@ static bool FindBlockPos(FlatFilePos &pos, unsigned int nAddSize, unsigned int n
32913290
bool out_of_space;
32923291
size_t bytes_allocated = BlockFileSeq().Allocate(pos, nAddSize, out_of_space);
32933292
if (out_of_space) {
3294-
return AbortNode("Disk space is too low!", _("Error: Disk space is too low!").translated, CClientUIInterface::MSG_NOPREFIX);
3293+
return AbortNode("Disk space is too low!", _("Error: Disk space is too low!"), CClientUIInterface::MSG_NOPREFIX);
32953294
}
32963295
if (bytes_allocated != 0 && fPruneMode) {
32973296
fCheckForPruning = true;
@@ -3315,7 +3314,7 @@ static bool FindUndoPos(BlockValidationState &state, int nFile, FlatFilePos &pos
33153314
bool out_of_space;
33163315
size_t bytes_allocated = UndoFileSeq().Allocate(pos, nAddSize, out_of_space);
33173316
if (out_of_space) {
3318-
return AbortNode(state, "Disk space is too low!", _("Error: Disk space is too low!").translated, CClientUIInterface::MSG_NOPREFIX);
3317+
return AbortNode(state, "Disk space is too low!", _("Error: Disk space is too low!"), CClientUIInterface::MSG_NOPREFIX);
33193318
}
33203319
if (bytes_allocated != 0 && fPruneMode) {
33213320
fCheckForPruning = true;

0 commit comments

Comments
 (0)