HomePhabricator

qt: Do not pass WalletModel* to a queued connection

Description

qt: Do not pass WalletModel* to a queued connection

Summary:
On master, the following queued connection

connect(this, &RPCConsole::cmdRequest, executor, &RPCExecutor::request);

uses a const WalletModel* parameter regardless whether the ENABLE_WALLET macro is defined.

Although this code works in Qt 5, it is flawed. On Qt 6, the code gets broken because the fully defined WalletModel type is required which is not the case if ENABLE_WALLET is undefined.

Guard RPCConsole::{add,remove}Wallet() with ENABLE_WALLET

Make RPCExecutor* a member of the RPCConsole class

Do not pass WalletModel* to queued connection

This is a backport of core-gui#589
Depends on D18163

Test Plan:
ninja all check-all

Run a wallet RPC command in the console

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D18164

Details

Provenance
Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>Authored on Apr 20 2022, 13:03
PiRKCommitted on Jun 2 2025, 09:21
PiRKPushed on Jun 2 2025, 09:21
Reviewer
Restricted Project
Differential Revision
D18164: qt: Do not pass WalletModel* to a queued connection
Parents
rABC0a567d65df81: qt: Replace `QCoreApplication::quit()` with `QCoreApplication::exit(0)`
Branches
Unknown
Tags
Unknown