mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-10 10:52:31 -05:00
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.
This commit is contained in:
parent
9ddf7e03a3
commit
3c06926cf2
1 changed files with 1 additions and 5 deletions
|
@ -33,11 +33,7 @@ constexpr auto SYNC_LOCATOR_WRITE_INTERVAL{30s};
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
static void FatalError(const char* fmt, const Args&... args)
|
static void FatalError(const char* fmt, const Args&... args)
|
||||||
{
|
{
|
||||||
std::string strMessage = tfm::format(fmt, args...);
|
AbortNode(tfm::format(fmt, args...));
|
||||||
SetMiscWarning(Untranslated(strMessage));
|
|
||||||
LogPrintf("*** %s\n", strMessage);
|
|
||||||
InitError(_("A fatal internal error occurred, see debug.log for details"));
|
|
||||||
StartShutdown();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CBlockLocator GetLocator(interfaces::Chain& chain, const uint256& block_hash)
|
CBlockLocator GetLocator(interfaces::Chain& chain, const uint256& block_hash)
|
||||||
|
|
Loading…
Add table
Reference in a new issue