From 104d4d6d99f62cea8a4332330ebedef8b5c26e63 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Date: Thu, 2 Jun 2022 23:48:27 +0530 Subject: [PATCH] qt: fetch existing parameters when building parameter list Co-authored-by: UdjinM6 --- src/qt/rpcconsole.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 7da5d6763c..481e099afa 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -820,8 +820,17 @@ void RPCConsole::walletReindex() void RPCConsole::buildParameterlist(QString arg) { // Get command-line arguments and remove the application name - QStringList args = QApplication::arguments(); - args.removeFirst(); + QStringList args; + + for (const auto& [key, values] : gArgs.GetCommandLineArgs()) { + for (const auto& value : values) { + if (value.getValStr().empty()) { + args << QString::fromStdString("-" + key); + } else { + args << QString::fromStdString("-" + key + "=" + value.getValStr()); + } + } + } // Remove existing repair-options args.removeAll(RESCAN1);