diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2023-06-07 00:04:57 +0200 |
---|---|---|
committer | furszy <matiasfurszyfer@protonmail.com> | 2023-06-08 16:38:36 -0300 |
commit | 3c06926cf21dcca3074ef51506f556b2286c299b (patch) | |
tree | 017eaa823a0f5065ae83c8d17d746158d91a3841 /src/index | |
parent | 9ddf7e03a35592617a016418fd320cc93c8d1abd (diff) | |
download | bitcoin-3c06926cf21dcca3074ef51506f556b2286c299b.tar.xz |
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.
Diffstat (limited to 'src/index')
-rw-r--r-- | src/index/base.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/index/base.cpp b/src/index/base.cpp index 3f91910db2..a713be3480 100644 --- a/src/index/base.cpp +++ b/src/index/base.cpp @@ -33,11 +33,7 @@ constexpr auto SYNC_LOCATOR_WRITE_INTERVAL{30s}; template <typename... Args> static void FatalError(const char* fmt, const Args&... args) { - std::string strMessage = tfm::format(fmt, args...); - SetMiscWarning(Untranslated(strMessage)); - LogPrintf("*** %s\n", strMessage); - InitError(_("A fatal internal error occurred, see debug.log for details")); - StartShutdown(); + AbortNode(tfm::format(fmt, args...)); } CBlockLocator GetLocator(interfaces::Chain& chain, const uint256& block_hash) |