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.
This commit is contained in:
1 parent
113b863f07
commit
a032fa30d2
5 files changed
+41
-12
No files matched your search
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user