Skip to content

Commit 3c06926

Browse files
theStackfurszy
authored andcommitted
refactor: index: use AbortNode in fatal error helper
Deduplicates code in the `FatalError` template function by using `AbortNode` which does the exact same thing if called without any user message (i.e. without second parameter specified). The template is still kept for ease-of-use w.r.t. not having to call `tfm::format(...)` at the call-side each time, and also to keep the diff minimal.
1 parent 9ddf7e0 commit 3c06926

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/index/base.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ constexpr auto SYNC_LOCATOR_WRITE_INTERVAL{30s};
3333
template <typename... Args>
3434
static void FatalError(const char* fmt, const Args&... args)
3535
{
36-
std::string strMessage = tfm::format(fmt, args...);
37-
SetMiscWarning(Untranslated(strMessage));
38-
LogPrintf("*** %s\n", strMessage);
39-
InitError(_("A fatal internal error occurred, see debug.log for details"));
40-
StartShutdown();
36+
AbortNode(tfm::format(fmt, args...));
4137
}
4238

4339
CBlockLocator GetLocator(interfaces::Chain& chain, const uint256& block_hash)

0 commit comments

Comments
 (0)