diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2021-06-16 14:49:09 -0400 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2021-10-05 11:10:47 -0400 |
commit | a032fa30d282fa69c304e0afd1f95f67c55d22e3 (patch) | |
tree | c4aea56786decc54ff8474a67c604530097d8b96 /src/qt | |
parent | 113b863f0773999497f952daa6539a03a66a9de3 (diff) |
multiprocess: add interfaces::ExternalSigner class
Add interfaces::ExternalSigner to let signer objects be passed between
processes and signer code to run in the original process, without
multiple processes linking and running signer code.
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/createwalletdialog.cpp | 6 | ||||
-rw-r--r-- | src/qt/createwalletdialog.h | 7 | ||||
-rw-r--r-- | src/qt/walletcontroller.cpp | 4 |
3 files changed, 11 insertions, 6 deletions
diff --git a/src/qt/createwalletdialog.cpp b/src/qt/createwalletdialog.cpp index f9a61c3e60..eba70331f8 100644 --- a/src/qt/createwalletdialog.cpp +++ b/src/qt/createwalletdialog.cpp @@ -6,7 +6,7 @@ #include <config/bitcoin-config.h> #endif -#include <external_signer.h> +#include <interfaces/node.h> #include <qt/createwalletdialog.h> #include <qt/forms/ui_createwalletdialog.h> @@ -113,7 +113,7 @@ CreateWalletDialog::~CreateWalletDialog() delete ui; } -void CreateWalletDialog::setSigners(const std::vector<ExternalSigner>& signers) +void CreateWalletDialog::setSigners(const std::vector<std::unique_ptr<interfaces::ExternalSigner>>& signers) { m_has_signers = !signers.empty(); if (m_has_signers) { @@ -126,7 +126,7 @@ void CreateWalletDialog::setSigners(const std::vector<ExternalSigner>& signers) ui->blank_wallet_checkbox->setChecked(false); ui->disable_privkeys_checkbox->setEnabled(false); ui->disable_privkeys_checkbox->setChecked(true); - const std::string label = signers[0].m_name; + const std::string label = signers[0]->getName(); ui->wallet_name_line_edit->setText(QString::fromStdString(label)); ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true); } else { diff --git a/src/qt/createwalletdialog.h b/src/qt/createwalletdialog.h index fc13cc44eb..63a5e012d8 100644 --- a/src/qt/createwalletdialog.h +++ b/src/qt/createwalletdialog.h @@ -7,7 +7,12 @@ #include <QDialog> +#include <memory> + +namespace interfaces { class ExternalSigner; +} // namespace interfaces + class WalletModel; namespace Ui { @@ -24,7 +29,7 @@ public: explicit CreateWalletDialog(QWidget* parent); virtual ~CreateWalletDialog(); - void setSigners(const std::vector<ExternalSigner>& signers); + void setSigners(const std::vector<std::unique_ptr<interfaces::ExternalSigner>>& signers); QString walletName() const; bool isEncryptWalletChecked() const; diff --git a/src/qt/walletcontroller.cpp b/src/qt/walletcontroller.cpp index 4c74bcd480..9c6349284e 100644 --- a/src/qt/walletcontroller.cpp +++ b/src/qt/walletcontroller.cpp @@ -274,9 +274,9 @@ void CreateWalletActivity::create() { m_create_wallet_dialog = new CreateWalletDialog(m_parent_widget); - std::vector<ExternalSigner> signers; + std::vector<std::unique_ptr<interfaces::ExternalSigner>> signers; try { - signers = node().externalSigners(); + signers = node().listExternalSigners(); } catch (const std::runtime_error& e) { QMessageBox::critical(nullptr, tr("Can't list signers"), e.what()); } |