diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.qt.include | 4 | ||||
-rw-r--r-- | src/Makefile.qttest.include | 1 | ||||
-rw-r--r-- | src/dummywallet.cpp | 7 | ||||
-rw-r--r-- | src/init.cpp | 3 | ||||
-rw-r--r-- | src/init/bitcoin-node.cpp | 9 | ||||
-rw-r--r-- | src/init/bitcoind.cpp | 11 | ||||
-rw-r--r-- | src/interfaces/node.h | 2 | ||||
-rw-r--r-- | src/node/interfaces.cpp | 4 | ||||
-rw-r--r-- | src/qt/addressbookpage.cpp | 2 | ||||
-rw-r--r-- | src/qt/bitcoin.cpp | 16 | ||||
-rw-r--r-- | src/qt/bitcoin.h | 8 | ||||
-rw-r--r-- | src/qt/forms/optionsdialog.ui | 6 | ||||
-rw-r--r-- | src/qt/optionsdialog.cpp | 20 | ||||
-rw-r--r-- | src/qt/qrimagewidget.cpp | 2 | ||||
-rw-r--r-- | src/qt/rpcconsole.cpp | 7 | ||||
-rw-r--r-- | src/qt/sendcoinsdialog.cpp | 2 | ||||
-rw-r--r-- | src/qt/test/addressbooktests.cpp | 2 | ||||
-rw-r--r-- | src/qt/test/test_main.cpp | 7 | ||||
-rw-r--r-- | src/qt/test/wallettests.cpp | 2 | ||||
-rw-r--r-- | src/qt/transactionview.cpp | 2 | ||||
-rw-r--r-- | src/rpc/misc.cpp | 5 | ||||
-rw-r--r-- | src/test/util/setup_common.cpp | 1 | ||||
-rw-r--r-- | src/wallet/init.cpp | 3 | ||||
-rw-r--r-- | src/wallet/rpcwallet.cpp | 5 |
24 files changed, 98 insertions, 33 deletions
diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 6f450bbc74..f4b0b3adbe 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -338,14 +338,14 @@ bitcoin_qt_libtoolflags = $(AM_LIBTOOLFLAGS) --tag CXX qt_bitcoin_qt_CPPFLAGS = $(bitcoin_qt_cppflags) qt_bitcoin_qt_CXXFLAGS = $(bitcoin_qt_cxxflags) -qt_bitcoin_qt_SOURCES = $(bitcoin_qt_sources) +qt_bitcoin_qt_SOURCES = $(bitcoin_qt_sources) init/bitcoind.cpp qt_bitcoin_qt_LDADD = $(bitcoin_qt_ldadd) qt_bitcoin_qt_LDFLAGS = $(bitcoin_qt_ldflags) qt_bitcoin_qt_LIBTOOLFLAGS = $(bitcoin_qt_libtoolflags) bitcoin_gui_CPPFLAGS = $(bitcoin_qt_cppflags) bitcoin_gui_CXXFLAGS = $(bitcoin_qt_cxxflags) -bitcoin_gui_SOURCES = $(bitcoin_qt_sources) +bitcoin_gui_SOURCES = $(bitcoin_qt_sources) init/bitcoind.cpp bitcoin_gui_LDADD = $(bitcoin_qt_ldadd) bitcoin_gui_LDFLAGS = $(bitcoin_qt_ldflags) bitcoin_gui_LIBTOOLFLAGS = $(bitcoin_qt_libtoolflags) diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 91a5e9fd9b..8a5521eeb5 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -28,6 +28,7 @@ qt_test_test_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_ $(QT_INCLUDES) $(QT_TEST_INCLUDES) qt_test_test_bitcoin_qt_SOURCES = \ + init/bitcoind.cpp \ qt/test/apptests.cpp \ qt/test/rpcnestedtests.cpp \ qt/test/test_main.cpp \ diff --git a/src/dummywallet.cpp b/src/dummywallet.cpp index 2d897f4c40..8caeb32627 100644 --- a/src/dummywallet.cpp +++ b/src/dummywallet.cpp @@ -5,12 +5,14 @@ #include <util/system.h> #include <walletinitinterface.h> +class ArgsManager; class CWallet; namespace interfaces { class Chain; class Handler; class Wallet; +class WalletClient; } class DummyWalletInit : public WalletInitInterface { @@ -64,4 +66,9 @@ std::unique_ptr<Wallet> MakeWallet(const std::shared_ptr<CWallet>& wallet) throw std::logic_error("Wallet function called in non-wallet build."); } +std::unique_ptr<WalletClient> MakeWalletClient(Chain& chain, ArgsManager& args) +{ + throw std::logic_error("Wallet function called in non-wallet build."); +} + } // namespace interfaces diff --git a/src/init.cpp b/src/init.cpp index d4ba441b0c..636b089cda 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -26,6 +26,7 @@ #include <index/txindex.h> #include <init/common.h> #include <interfaces/chain.h> +#include <interfaces/init.h> #include <interfaces/node.h> #include <mapport.h> #include <miner.h> @@ -1063,7 +1064,7 @@ bool AppInitLockDataDirectory() bool AppInitInterfaces(NodeContext& node) { - node.chain = interfaces::MakeChain(node); + node.chain = node.init->makeChain(); // Create client interfaces for wallets that are supposed to be loaded // according to -wallet and -disablewallet options. This only constructs // the interfaces, it doesn't load wallet data. Wallets actually get loaded diff --git a/src/init/bitcoin-node.cpp b/src/init/bitcoin-node.cpp index 6b6157c139..fa56153745 100644 --- a/src/init/bitcoin-node.cpp +++ b/src/init/bitcoin-node.cpp @@ -2,9 +2,12 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include <interfaces/chain.h> #include <interfaces/echo.h> #include <interfaces/init.h> #include <interfaces/ipc.h> +#include <interfaces/node.h> +#include <interfaces/wallet.h> #include <node/context.h> #include <util/system.h> @@ -24,6 +27,12 @@ public: m_node.args = &gArgs; m_node.init = this; } + std::unique_ptr<interfaces::Node> makeNode() override { return interfaces::MakeNode(m_node); } + std::unique_ptr<interfaces::Chain> makeChain() override { return interfaces::MakeChain(m_node); } + std::unique_ptr<interfaces::WalletClient> makeWalletClient(interfaces::Chain& chain) override + { + return MakeWalletClient(chain, *Assert(m_node.args)); + } std::unique_ptr<interfaces::Echo> makeEcho() override { return interfaces::MakeEcho(); } interfaces::Ipc* ipc() override { return m_ipc.get(); } NodeContext& m_node; diff --git a/src/init/bitcoind.cpp b/src/init/bitcoind.cpp index 1d4504c24f..9c8d5bd9bb 100644 --- a/src/init/bitcoind.cpp +++ b/src/init/bitcoind.cpp @@ -2,7 +2,11 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include <interfaces/chain.h> +#include <interfaces/echo.h> #include <interfaces/init.h> +#include <interfaces/node.h> +#include <interfaces/wallet.h> #include <node/context.h> #include <util/system.h> @@ -18,6 +22,13 @@ public: m_node.args = &gArgs; m_node.init = this; } + std::unique_ptr<interfaces::Node> makeNode() override { return interfaces::MakeNode(m_node); } + std::unique_ptr<interfaces::Chain> makeChain() override { return interfaces::MakeChain(m_node); } + std::unique_ptr<interfaces::WalletClient> makeWalletClient(interfaces::Chain& chain) override + { + return MakeWalletClient(chain, *Assert(m_node.args)); + } + std::unique_ptr<interfaces::Echo> makeEcho() override { return interfaces::MakeEcho(); } NodeContext& m_node; }; } // namespace diff --git a/src/interfaces/node.h b/src/interfaces/node.h index 77129423db..770b1b8753 100644 --- a/src/interfaces/node.h +++ b/src/interfaces/node.h @@ -230,7 +230,7 @@ public: }; //! Return implementation of Node interface. -std::unique_ptr<Node> MakeNode(NodeContext* context = nullptr); +std::unique_ptr<Node> MakeNode(NodeContext& context); //! Block tip (could be a header or not, depends on the subscribed signal). struct BlockTip { diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index b46ad0333e..c62d7e5d0b 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -72,7 +72,7 @@ class NodeImpl : public Node private: ChainstateManager& chainman() { return *Assert(m_context->chainman); } public: - explicit NodeImpl(NodeContext* context) { setContext(context); } + explicit NodeImpl(NodeContext& context) { setContext(&context); } void initLogging() override { InitLogging(*Assert(m_context->args)); } void initParameterInteraction() override { InitParameterInteraction(*Assert(m_context->args)); } bilingual_str getWarnings() override { return GetWarnings(true); } @@ -710,6 +710,6 @@ public: } // namespace node namespace interfaces { -std::unique_ptr<Node> MakeNode(NodeContext* context) { return std::make_unique<node::NodeImpl>(context); } +std::unique_ptr<Node> MakeNode(NodeContext& context) { return std::make_unique<node::NodeImpl>(context); } std::unique_ptr<Chain> MakeChain(NodeContext& context) { return std::make_unique<node::ChainImpl>(context); } } // namespace interfaces diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp index c31f0aceea..e78594390b 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -282,7 +282,7 @@ void AddressBookPage::on_exportButton_clicked() QString filename = GUIUtil::getSaveFileName(this, tr("Export Address List"), QString(), /*: Expanded name of the CSV file format. - See https://en.wikipedia.org/wiki/Comma-separated_values */ + See: https://en.wikipedia.org/wiki/Comma-separated_values. */ tr("Comma separated file") + QLatin1String(" (*.csv)"), nullptr); if (filename.isNull()) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index f6ea147ddb..d4895ea6ff 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -11,6 +11,7 @@ #include <chainparams.h> #include <init.h> #include <interfaces/handler.h> +#include <interfaces/init.h> #include <interfaces/node.h> #include <node/context.h> #include <node/ui_interface.h> @@ -275,10 +276,10 @@ void BitcoinApplication::createSplashScreen(const NetworkStyle *networkStyle) connect(this, &BitcoinApplication::requestedShutdown, m_splash, &QWidget::close); } -void BitcoinApplication::setNode(interfaces::Node& node) +void BitcoinApplication::createNode(interfaces::Init& init) { assert(!m_node); - m_node = &node; + m_node = init.makeNode(); if (optionsModel) optionsModel->setNode(*m_node); if (m_splash) m_splash->setNode(*m_node); } @@ -460,11 +461,13 @@ int GuiMain(int argc, char* argv[]) util::WinCmdLineArgs winArgs; std::tie(argc, argv) = winArgs.get(); #endif - SetupEnvironment(); - util::ThreadSetInternalName("main"); NodeContext node_context; - std::unique_ptr<interfaces::Node> node = interfaces::MakeNode(&node_context); + int unused_exit_status; + std::unique_ptr<interfaces::Init> init = interfaces::MakeNodeInit(node_context, argc, argv, unused_exit_status); + + SetupEnvironment(); + util::ThreadSetInternalName("main"); // Subscribe to global signals from core boost::signals2::scoped_connection handler_message_box = ::uiInterface.ThreadSafeMessageBox_connect(noui_ThreadSafeMessageBox); @@ -492,7 +495,6 @@ int GuiMain(int argc, char* argv[]) /// 2. Parse command-line options. We do this after qt in order to show an error if there are problems parsing these // Command-line options take precedence: - node_context.args = &gArgs; SetupServerArgs(gArgs); SetupUIArgs(gArgs); std::string error; @@ -623,7 +625,7 @@ int GuiMain(int argc, char* argv[]) if (gArgs.GetBoolArg("-splash", DEFAULT_SPLASHSCREEN) && !gArgs.GetBoolArg("-min", false)) app.createSplashScreen(networkStyle.data()); - app.setNode(*node); + app.createNode(*init); int rv = EXIT_SUCCESS; try diff --git a/src/qt/bitcoin.h b/src/qt/bitcoin.h index ed2f26b7f3..602b76052c 100644 --- a/src/qt/bitcoin.h +++ b/src/qt/bitcoin.h @@ -27,6 +27,9 @@ class PlatformStyle; class SplashScreen; class WalletController; class WalletModel; +namespace interfaces { +class Init; +} // namespace interfaces /** Main Bitcoin application object */ @@ -51,6 +54,8 @@ public: void createWindow(const NetworkStyle *networkStyle); /// Create splash screen void createSplashScreen(const NetworkStyle *networkStyle); + /// Create or spawn node + void createNode(interfaces::Init& init); /// Basic initialization, before starting initialization/shutdown thread. Return true on success. bool baseInitialize(); @@ -69,7 +74,6 @@ public: void setupPlatformStyle(); interfaces::Node& node() const { assert(m_node); return *m_node; } - void setNode(interfaces::Node& node); public Q_SLOTS: void initializeResult(bool success, interfaces::BlockAndHeaderTipInfo tip_info); @@ -103,7 +107,7 @@ private: const PlatformStyle *platformStyle; std::unique_ptr<QWidget> shutdownWindow; SplashScreen* m_splash = nullptr; - interfaces::Node* m_node = nullptr; + std::unique_ptr<interfaces::Node> m_node; void startThread(); }; diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 2ff1445709..59d220636d 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -104,6 +104,9 @@ <layout class="QHBoxLayout" name="horizontalLayout_2_Main"> <item> <widget class="QLabel" name="databaseCacheLabel"> + <property name="toolTip"> + <string extracomment="Tooltip text for Options window setting that sets the size of the database cache. Explains the corresponding effects of increasing/decreasing this value.">Maximum database cache size. A larger cache can contribute to faster sync, after which the benefit is less pronounced for most use cases. Lowering the cache size will reduce memory usage. Unused mempool memory is shared for this cache.</string> + </property> <property name="text"> <string>Size of &database cache</string> </property> @@ -147,6 +150,9 @@ <layout class="QHBoxLayout" name="horizontalLayout_Main_VerifyLabel"> <item> <widget class="QLabel" name="threadsScriptVerifLabel"> + <property name="toolTip"> + <string extracomment="Tooltip text for Options window setting that sets the number of script verification threads. Explains that negative values mean to leave these many cores free to the system.">Set the number of script verification threads. Negative values correspond to the number of cores you want to leave free to the system.</string> + </property> <property name="text"> <string>Number of script &verification threads</string> </property> diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 5ad4fc9b33..92644ef24b 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -296,10 +296,22 @@ void OptionsDialog::on_resetButton_clicked() void OptionsDialog::on_openBitcoinConfButton_clicked() { - /* explain the purpose of the config file */ - QMessageBox::information(this, tr("Configuration options"), - tr("The configuration file is used to specify advanced user options which override GUI settings. " - "Additionally, any command-line options will override this configuration file.")); + QMessageBox config_msgbox(this); + config_msgbox.setIcon(QMessageBox::Information); + //: Window title text of pop-up box that allows opening up of configuration file. + config_msgbox.setWindowTitle(tr("Configuration options")); + /*: Explanatory text about the priority order of instructions considered by client. + The order from high to low being: command-line, configuration file, GUI settings. */ + config_msgbox.setText(tr("The configuration file is used to specify advanced user options which override GUI settings. " + "Additionally, any command-line options will override this configuration file.")); + + QPushButton* open_button = config_msgbox.addButton(tr("Continue"), QMessageBox::ActionRole); + config_msgbox.addButton(tr("Cancel"), QMessageBox::RejectRole); + open_button->setDefault(true); + + config_msgbox.exec(); + + if (config_msgbox.clickedButton() != open_button) return; /* show an error if there was some problem opening the file */ if (!GUIUtil::openBitcoinConf()) diff --git a/src/qt/qrimagewidget.cpp b/src/qt/qrimagewidget.cpp index 7cdd568644..0799e01aac 100644 --- a/src/qt/qrimagewidget.cpp +++ b/src/qt/qrimagewidget.cpp @@ -119,7 +119,7 @@ void QRImageWidget::saveImage() QString fn = GUIUtil::getSaveFileName( this, tr("Save QR Code"), QString(), /*: Expanded name of the PNG file format. - See https://en.wikipedia.org/wiki/Portable_Network_Graphics */ + See: https://en.wikipedia.org/wiki/Portable_Network_Graphics. */ tr("PNG Image") + QLatin1String(" (*.png)"), nullptr); if (!fn.isEmpty()) { diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 829f7add80..4554f11a41 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -680,6 +680,11 @@ void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_ // create peer table context menu peersTableContextMenu = new QMenu(this); + //: Context menu action to copy the address of a peer. + peersTableContextMenu->addAction(tr("&Copy address"), [this] { + GUIUtil::copyEntryData(ui->peerWidget, PeerTableModel::Address, Qt::DisplayRole); + }); + peersTableContextMenu->addSeparator(); peersTableContextMenu->addAction(tr("&Disconnect"), this, &RPCConsole::disconnectSelectedNode); peersTableContextMenu->addAction(ts.ban_for + " " + tr("1 &hour"), [this] { banSelectedNode(60 * 60); }); peersTableContextMenu->addAction(ts.ban_for + " " + tr("1 d&ay"), [this] { banSelectedNode(60 * 60 * 24); }); @@ -708,7 +713,7 @@ void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_ banTableContextMenu = new QMenu(this); /*: Context menu action to copy the IP/Netmask of a banned peer. IP/Netmask is the combination of a peer's IP address and its Netmask. - For IP address see: https://en.wikipedia.org/wiki/IP_address */ + For IP address, see: https://en.wikipedia.org/wiki/IP_address. */ banTableContextMenu->addAction(tr("&Copy IP/Netmask"), [this] { GUIUtil::copyEntryData(ui->banlistWidget, BanTableModel::Address, Qt::DisplayRole); }); diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index c9bf757dfc..ff53d8160f 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -200,7 +200,7 @@ void SendCoinsDialog::setModel(WalletModel *_model) ui->optInRBF->setCheckState(Qt::Checked); if (model->wallet().hasExternalSigner()) { - //: "device" usually means a hardware wallet + //: "device" usually means a hardware wallet. ui->sendButton->setText(tr("Sign on device")); if (gArgs.GetArg("-signer", "") != "") { ui->sendButton->setEnabled(true); diff --git a/src/qt/test/addressbooktests.cpp b/src/qt/test/addressbooktests.cpp index f4d561286e..0de781661a 100644 --- a/src/qt/test/addressbooktests.cpp +++ b/src/qt/test/addressbooktests.cpp @@ -60,6 +60,8 @@ void EditAddressAndSubmit( void TestAddAddressesToSendBook(interfaces::Node& node) { TestChain100Setup test; + auto wallet_client = interfaces::MakeWalletClient(*test.m_node.chain, *Assert(test.m_node.args)); + test.m_node.wallet_client = wallet_client.get(); node.setContext(&test.m_node); std::shared_ptr<CWallet> wallet = std::make_shared<CWallet>(node.context()->chain.get(), "", CreateMockWalletDatabase()); wallet->SetupLegacyScriptPubKeyMan(); diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp index 7d66f67f8a..884ed25637 100644 --- a/src/qt/test/test_main.cpp +++ b/src/qt/test/test_main.cpp @@ -6,6 +6,7 @@ #include <config/bitcoin-config.h> #endif +#include <interfaces/init.h> #include <interfaces/node.h> #include <qt/bitcoin.h> #include <qt/initexecutor.h> @@ -53,7 +54,8 @@ int main(int argc, char* argv[]) } NodeContext node_context; - std::unique_ptr<interfaces::Node> node = interfaces::MakeNode(&node_context); + int unused_exit_status; + std::unique_ptr<interfaces::Init> init = interfaces::MakeNodeInit(node_context, argc, argv, unused_exit_status); gArgs.ForceSetArg("-listen", "0"); gArgs.ForceSetArg("-listenonion", "0"); gArgs.ForceSetArg("-discover", "0"); @@ -76,10 +78,9 @@ int main(int argc, char* argv[]) // Don't remove this, it's needed to access // QApplication:: and QCoreApplication:: in the tests BitcoinApplication app; - app.setNode(*node); app.setApplicationName("Bitcoin-Qt-test"); + app.createNode(*init); - app.node().context()->args = &gArgs; // Make gArgs available in the NodeContext AppTests app_tests(app); if (QTest::qExec(&app_tests) != 0) { fInvalid = true; diff --git a/src/qt/test/wallettests.cpp b/src/qt/test/wallettests.cpp index 89f2258c0d..62b135d3f1 100644 --- a/src/qt/test/wallettests.cpp +++ b/src/qt/test/wallettests.cpp @@ -138,6 +138,8 @@ void TestGUI(interfaces::Node& node) for (int i = 0; i < 5; ++i) { test.CreateAndProcessBlock({}, GetScriptForRawPubKey(test.coinbaseKey.GetPubKey())); } + auto wallet_client = interfaces::MakeWalletClient(*test.m_node.chain, *Assert(test.m_node.args)); + test.m_node.wallet_client = wallet_client.get(); node.setContext(&test.m_node); std::shared_ptr<CWallet> wallet = std::make_shared<CWallet>(node.context()->chain.get(), "", CreateMockWalletDatabase()); wallet->LoadWallet(); diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 908cb917f1..2f16e6edb4 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -353,7 +353,7 @@ void TransactionView::exportClicked() QString filename = GUIUtil::getSaveFileName(this, tr("Export Transaction History"), QString(), /*: Expanded name of the CSV file format. - See https://en.wikipedia.org/wiki/Comma-separated_values */ + See: https://en.wikipedia.org/wiki/Comma-separated_values. */ tr("Comma separated file") + QLatin1String(" (*.csv)"), nullptr); if (filename.isNull()) diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index e5804211f3..14b0e5a984 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -670,8 +670,9 @@ static RPCHelpMan echoipc() RPCExamples{HelpExampleCli("echo", "\"Hello world\"") + HelpExampleRpc("echo", "\"Hello world\"")}, [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue { + interfaces::Init& local_init = *EnsureAnyNodeContext(request.context).init; std::unique_ptr<interfaces::Echo> echo; - if (interfaces::Ipc* ipc = Assert(EnsureAnyNodeContext(request.context).init)->ipc()) { + if (interfaces::Ipc* ipc = local_init.ipc()) { // Spawn a new bitcoin-node process and call makeEcho to get a // client pointer to a interfaces::Echo instance running in // that process. This is just for testing. A slightly more @@ -689,7 +690,7 @@ static RPCHelpMan echoipc() // interfaces::Echo object and return it so the `echoipc` RPC // method will work, and the python test calling `echoipc` // can expect the same result. - echo = interfaces::MakeEcho(); + echo = local_init.makeEcho(); } return echo->echo(request.params[0].get_str()); }, diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index ba6b3e32ea..cabc4b3b49 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -114,7 +114,6 @@ BasicTestingSetup::BasicTestingSetup(const std::string& chainName, const std::ve InitSignatureCache(); InitScriptExecutionCache(); m_node.chain = interfaces::MakeChain(m_node); - g_wallet_init_interface.Construct(m_node); fCheckBlockIndex = true; static bool noui_connected = false; if (!noui_connected) { diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp index bb5f0cceff..7abdbb0e55 100644 --- a/src/wallet/init.cpp +++ b/src/wallet/init.cpp @@ -5,6 +5,7 @@ #include <init.h> #include <interfaces/chain.h> +#include <interfaces/init.h> #include <interfaces/wallet.h> #include <net.h> #include <node/context.h> @@ -130,7 +131,7 @@ void WalletInit::Construct(NodeContext& node) const LogPrintf("Wallet disabled!\n"); return; } - auto wallet_client = interfaces::MakeWalletClient(*node.chain, args); + auto wallet_client = node.init->makeWalletClient(*node.chain); node.wallet_client = wallet_client.get(); node.chain_clients.emplace_back(std::move(wallet_client)); } diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index ff9e10c5ad..e922f4ede9 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -4650,10 +4650,11 @@ static RPCHelpMan upgradewallet() #ifdef ENABLE_EXTERNAL_SIGNER static RPCHelpMan walletdisplayaddress() { - return RPCHelpMan{"walletdisplayaddress", + return RPCHelpMan{ + "walletdisplayaddress", "Display address on an external signer for verification.", { - {"address", RPCArg::Type::STR, RPCArg::Optional::NO, /* default_val */ "", "bitcoin address to display"}, + {"address", RPCArg::Type::STR, RPCArg::Optional::NO, "bitcoin address to display"}, }, RPCResult{ RPCResult::Type::OBJ,"","", |