Merge bitcoin/bitcoin#33215: Fix compatibility with -debuglogfile command-line option

ddf2a064de Fix compatibility with `-debuglogfile` command-line option (Hennadii Stepanov)

Pull request description:

  This PR avoids hardcoding the "debug.log" filename, ensuring compatibility with custom filenames provided via the `-debuglogfile` command-line option.

ACKs for top commit:
  maflcko:
    review ACK ddf2a064de 🐪
  achow101:
    ACK ddf2a064de
  sedited:
    ACK ddf2a064de

Tree-SHA512: bcf8f4e9407ed6108dbb7bfee673a6a486cd0afaaf1dcfb7aaa2d2c6a85488f9c57557b53033efa5eed723ec842c87c4616b6c078f049787e634cc02cbb740ea
This commit is contained in:
Ava Chow
2026-03-19 16:41:05 -07:00
5 changed files with 6 additions and 5 deletions

View File

@@ -7,6 +7,7 @@
#include <logging.h>
#include <node/interface_ui.h>
#include <node/warnings.h>
#include <util/fs.h>
#include <util/signalinterrupt.h>
#include <util/translation.h>
@@ -18,7 +19,7 @@ namespace node {
void AbortNode(const std::function<bool()>& shutdown_request, std::atomic<int>& exit_status, const bilingual_str& message, node::Warnings* warnings)
{
if (warnings) warnings->Set(Warning::FATAL_INTERNAL_ERROR, message);
InitError(_("A fatal internal error occurred, see debug.log for details: ") + message);
InitError(strprintf(_("A fatal internal error occurred, see %s for details: %s"), fs::PathToString(LogInstance().m_file_path.filename()), message));
exit_status.store(EXIT_FAILURE);
if (shutdown_request && !shutdown_request()) {
LogError("Failed to send shutdown signal\n");