aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/README.md2
-rw-r--r--src/qt/addressbookpage.h2
-rw-r--r--src/qt/addresstablemodel.cpp36
-rw-r--r--src/qt/addresstablemodel.h15
-rw-r--r--src/qt/editaddressdialog.cpp21
-rw-r--r--src/qt/editaddressdialog.h5
-rw-r--r--src/qt/paymentserver.cpp2
-rw-r--r--src/qt/rpcconsole.cpp7
-rw-r--r--src/qt/rpcconsole.h18
-rw-r--r--src/qt/test/addressbooktests.cpp143
-rw-r--r--src/qt/test/addressbooktests.h15
-rw-r--r--src/qt/test/test_main.cpp5
-rw-r--r--src/qt/test/util.cpp22
-rw-r--r--src/qt/test/util.h12
-rw-r--r--src/qt/test/wallettests.cpp18
-rw-r--r--src/qt/transactiondesc.cpp10
-rw-r--r--src/qt/walletmodel.cpp3
-rw-r--r--src/qt/walletmodel.h2
18 files changed, 280 insertions, 58 deletions
diff --git a/src/qt/README.md b/src/qt/README.md
index 7c23ccadcc..d8acf96ceb 100644
--- a/src/qt/README.md
+++ b/src/qt/README.md
@@ -16,7 +16,7 @@ To run:
### forms
-Contains [Designer UI](http://doc.qt.io/qt-5.9/designer-using-a-ui-file.html) files. They are created with [Qt Creator](#use-qt-Creator-as IDE), but can be edited using any text editor.
+Contains [Designer UI](http://doc.qt.io/qt-5.9/designer-using-a-ui-file.html) files. They are created with [Qt Creator](#using-qt-creator-as-ide), but can be edited using any text editor.
### locale
diff --git a/src/qt/addressbookpage.h b/src/qt/addressbookpage.h
index 8877d07330..ba420c5e15 100644
--- a/src/qt/addressbookpage.h
+++ b/src/qt/addressbookpage.h
@@ -38,7 +38,7 @@ public:
ForEditing /**< Open address book for editing */
};
- explicit AddressBookPage(const PlatformStyle *platformStyle, Mode mode, Tabs tab, QWidget *parent);
+ explicit AddressBookPage(const PlatformStyle *platformStyle, Mode mode, Tabs tab, QWidget *parent = 0);
~AddressBookPage();
void setModel(AddressTableModel *model);
diff --git a/src/qt/addresstablemodel.cpp b/src/qt/addresstablemodel.cpp
index 1e3acd75c0..25b615e6f8 100644
--- a/src/qt/addresstablemodel.cpp
+++ b/src/qt/addresstablemodel.cpp
@@ -159,7 +159,7 @@ public:
};
AddressTableModel::AddressTableModel(WalletModel *parent) :
- QAbstractTableModel(parent),walletModel(parent),priv(0)
+ QAbstractTableModel(parent), walletModel(parent)
{
columns << tr("Label") << tr("Address");
priv = new AddressTablePriv(this);
@@ -266,7 +266,8 @@ bool AddressTableModel::setData(const QModelIndex &index, const QVariant &value,
}
// Check for duplicate addresses to prevent accidental deletion of addresses, if you try
// to paste an existing address over another address (with a different label)
- if (walletModel->wallet().getAddress(newAddress))
+ if (walletModel->wallet().getAddress(
+ newAddress, /* name= */ nullptr, /* is_mine= */ nullptr, /* purpose= */ nullptr))
{
editStatus = DUPLICATE_ADDRESS;
return false;
@@ -351,7 +352,8 @@ QString AddressTableModel::addRow(const QString &type, const QString &label, con
}
// Check for duplicate addresses
{
- if(walletModel->wallet().getAddress(DecodeDestination(strAddress)))
+ if (walletModel->wallet().getAddress(
+ DecodeDestination(strAddress), /* name= */ nullptr, /* is_mine= */ nullptr, /* purpose= */ nullptr))
{
editStatus = DUPLICATE_ADDRESS;
return QString();
@@ -405,21 +407,31 @@ bool AddressTableModel::removeRows(int row, int count, const QModelIndex &parent
return true;
}
-/* Look up label for address in address book, if not found return empty string.
- */
QString AddressTableModel::labelForAddress(const QString &address) const
{
- {
- CTxDestination destination = DecodeDestination(address.toStdString());
- std::string name;
- if (walletModel->wallet().getAddress(destination, &name))
- {
- return QString::fromStdString(name);
- }
+ std::string name;
+ if (getAddressData(address, &name, /* purpose= */ nullptr)) {
+ return QString::fromStdString(name);
+ }
+ return QString();
+}
+
+QString AddressTableModel::purposeForAddress(const QString &address) const
+{
+ std::string purpose;
+ if (getAddressData(address, /* name= */ nullptr, &purpose)) {
+ return QString::fromStdString(purpose);
}
return QString();
}
+bool AddressTableModel::getAddressData(const QString &address,
+ std::string* name,
+ std::string* purpose) const {
+ CTxDestination destination = DecodeDestination(address.toStdString());
+ return walletModel->wallet().getAddress(destination, name, /* is_mine= */ nullptr, purpose);
+}
+
int AddressTableModel::lookupAddress(const QString &address) const
{
QModelIndexList lst = match(index(0, Address, QModelIndex()),
diff --git a/src/qt/addresstablemodel.h b/src/qt/addresstablemodel.h
index d7aeda9d8e..6e1b53b049 100644
--- a/src/qt/addresstablemodel.h
+++ b/src/qt/addresstablemodel.h
@@ -67,10 +67,12 @@ public:
*/
QString addRow(const QString &type, const QString &label, const QString &address, const OutputType address_type);
- /* Look up label for address in address book, if not found return empty string.
- */
+ /** Look up label for address in address book, if not found return empty string. */
QString labelForAddress(const QString &address) const;
+ /** Look up purpose for address in address book, if not found return empty string. */
+ QString purposeForAddress(const QString &address) const;
+
/* Look up row index of an address in the model.
Return -1 if not found.
*/
@@ -81,10 +83,13 @@ public:
OutputType GetDefaultAddressType() const;
private:
- WalletModel *walletModel;
- AddressTablePriv *priv;
+ WalletModel* const walletModel;
+ AddressTablePriv *priv = nullptr;
QStringList columns;
- EditStatus editStatus;
+ EditStatus editStatus = OK;
+
+ /** Look up address book data given an address string. */
+ bool getAddressData(const QString &address, std::string* name, std::string* purpose) const;
/** Notify listeners that data changed. */
void emitDataChanged(int index);
diff --git a/src/qt/editaddressdialog.cpp b/src/qt/editaddressdialog.cpp
index 38411c499f..f26a31158e 100644
--- a/src/qt/editaddressdialog.cpp
+++ b/src/qt/editaddressdialog.cpp
@@ -109,7 +109,7 @@ void EditAddressDialog::accept()
break;
case AddressTableModel::DUPLICATE_ADDRESS:
QMessageBox::warning(this, windowTitle(),
- tr("The entered address \"%1\" is already in the address book.").arg(ui->addressEdit->text()),
+ getDuplicateAddressWarning(),
QMessageBox::Ok, QMessageBox::Ok);
break;
case AddressTableModel::WALLET_UNLOCK_FAILURE:
@@ -129,6 +129,25 @@ void EditAddressDialog::accept()
QDialog::accept();
}
+QString EditAddressDialog::getDuplicateAddressWarning() const
+{
+ QString dup_address = ui->addressEdit->text();
+ QString existing_label = model->labelForAddress(dup_address);
+ QString existing_purpose = model->purposeForAddress(dup_address);
+
+ if (existing_purpose == "receive" &&
+ (mode == NewSendingAddress || mode == EditSendingAddress)) {
+ return tr(
+ "Address \"%1\" already exists as a receiving address with label "
+ "\"%2\" and so cannot be added as a sending address."
+ ).arg(dup_address).arg(existing_label);
+ }
+ return tr(
+ "The entered address \"%1\" is already in the address book with "
+ "label \"%2\"."
+ ).arg(dup_address).arg(existing_label);
+}
+
QString EditAddressDialog::getAddress() const
{
return address;
diff --git a/src/qt/editaddressdialog.h b/src/qt/editaddressdialog.h
index 41c5d1708a..3aba74bf08 100644
--- a/src/qt/editaddressdialog.h
+++ b/src/qt/editaddressdialog.h
@@ -30,7 +30,7 @@ public:
EditSendingAddress
};
- explicit EditAddressDialog(Mode mode, QWidget *parent);
+ explicit EditAddressDialog(Mode mode, QWidget *parent = 0);
~EditAddressDialog();
void setModel(AddressTableModel *model);
@@ -45,6 +45,9 @@ public Q_SLOTS:
private:
bool saveCurrentRow();
+ /** Return a descriptive string when adding an already-existing address fails. */
+ QString getDuplicateAddressWarning() const;
+
Ui::EditAddressDialog *ui;
QDataWidgetMapper *mapper;
Mode mode;
diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp
index 70cdb3361c..59bb5d5bb6 100644
--- a/src/qt/paymentserver.cpp
+++ b/src/qt/paymentserver.cpp
@@ -648,7 +648,7 @@ void PaymentServer::fetchPaymentACK(WalletModel* walletModel, const SendCoinsRec
// use for change. Despite an actual payment and not change, this is a close match:
// it's the output type we use subject to privacy issues, but not restricted by what
// other software supports.
- const OutputType change_type = walletModel->wallet().getDefaultChangeType() != OutputType::NONE ? walletModel->wallet().getDefaultChangeType() : walletModel->wallet().getDefaultAddressType();
+ const OutputType change_type = walletModel->wallet().getDefaultChangeType() != OutputType::CHANGE_AUTO ? walletModel->wallet().getDefaultChangeType() : walletModel->wallet().getDefaultAddressType();
walletModel->wallet().learnRelatedScripts(newKey, change_type);
CTxDestination dest = GetDestinationForKey(newKey, change_type);
std::string label = tr("Refund from %1").arg(recipient.authenticatedMerchant).toStdString();
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 5122bab36f..7924840d0b 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -455,12 +455,7 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
QWidget(parent),
m_node(node),
ui(new Ui::RPCConsole),
- clientModel(0),
- historyPtr(0),
- platformStyle(_platformStyle),
- peersTableContextMenu(0),
- banTableContextMenu(0),
- consoleFontSize(0)
+ platformStyle(_platformStyle)
{
ui->setupUi(this);
QSettings settings;
diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h
index a9a60d09f1..a53c4c24f9 100644
--- a/src/qt/rpcconsole.h
+++ b/src/qt/rpcconsole.h
@@ -145,18 +145,18 @@ private:
};
interfaces::Node& m_node;
- Ui::RPCConsole *ui;
- ClientModel *clientModel;
+ Ui::RPCConsole* const ui;
+ ClientModel *clientModel = nullptr;
QStringList history;
- int historyPtr;
+ int historyPtr = 0;
QString cmdBeforeBrowsing;
QList<NodeId> cachedNodeids;
- const PlatformStyle *platformStyle;
- RPCTimerInterface *rpcTimerInterface;
- QMenu *peersTableContextMenu;
- QMenu *banTableContextMenu;
- int consoleFontSize;
- QCompleter *autoCompleter;
+ const PlatformStyle* const platformStyle;
+ RPCTimerInterface *rpcTimerInterface = nullptr;
+ QMenu *peersTableContextMenu = nullptr;
+ QMenu *banTableContextMenu = nullptr;
+ int consoleFontSize = 0;
+ QCompleter *autoCompleter = nullptr;
QThread thread;
QString m_last_wallet_id;
diff --git a/src/qt/test/addressbooktests.cpp b/src/qt/test/addressbooktests.cpp
new file mode 100644
index 0000000000..0c2e7ae71d
--- /dev/null
+++ b/src/qt/test/addressbooktests.cpp
@@ -0,0 +1,143 @@
+#include <qt/test/addressbooktests.h>
+#include <qt/test/util.h>
+#include <test/test_bitcoin.h>
+
+#include <interfaces/node.h>
+#include <qt/addressbookpage.h>
+#include <qt/addresstablemodel.h>
+#include <qt/editaddressdialog.h>
+#include <qt/callback.h>
+#include <qt/optionsmodel.h>
+#include <qt/platformstyle.h>
+#include <qt/qvalidatedlineedit.h>
+#include <qt/walletmodel.h>
+
+#include <key.h>
+#include <pubkey.h>
+#include <key_io.h>
+#include <wallet/wallet.h>
+
+#include <QTimer>
+#include <QMessageBox>
+
+namespace
+{
+
+/**
+ * Fill the edit address dialog box with data, submit it, and ensure that
+ * the resulting message meets expectations.
+ */
+void EditAddressAndSubmit(
+ EditAddressDialog* dialog,
+ const QString& label, const QString& address, QString expected_msg)
+{
+ QString warning_text;
+
+ dialog->findChild<QLineEdit*>("labelEdit")->setText(label);
+ dialog->findChild<QValidatedLineEdit*>("addressEdit")->setText(address);
+
+ ConfirmMessage(&warning_text, 5);
+ dialog->accept();
+ QCOMPARE(warning_text, expected_msg);
+}
+
+/**
+ * Test adding various send addresses to the address book.
+ *
+ * There are three cases tested:
+ *
+ * - new_address: a new address which should add as a send address successfully.
+ * - existing_s_address: an existing sending address which won't add successfully.
+ * - existing_r_address: an existing receiving address which won't add successfully.
+ *
+ * In each case, verify the resulting state of the address book and optionally
+ * the warning message presented to the user.
+ */
+void TestAddAddressesToSendBook()
+{
+ TestChain100Setup test;
+ CWallet wallet("mock", WalletDatabase::CreateMock());
+ bool firstRun;
+ wallet.LoadWallet(firstRun);
+
+ auto build_address = [&wallet]() {
+ CKey key;
+ key.MakeNewKey(true);
+ CTxDestination dest(GetDestinationForKey(
+ key.GetPubKey(), wallet.m_default_address_type));
+
+ return std::make_pair(dest, QString::fromStdString(EncodeDestination(dest)));
+ };
+
+ CTxDestination r_key_dest, s_key_dest;
+
+ // Add a preexisting "receive" entry in the address book.
+ QString preexisting_r_address;
+ QString r_label("already here (r)");
+
+ // Add a preexisting "send" entry in the address book.
+ QString preexisting_s_address;
+ QString s_label("already here (s)");
+
+ // Define a new address (which should add to the address book successfully).
+ QString new_address;
+
+ std::tie(r_key_dest, preexisting_r_address) = build_address();
+ std::tie(s_key_dest, preexisting_s_address) = build_address();
+ std::tie(std::ignore, new_address) = build_address();
+
+ {
+ LOCK(wallet.cs_wallet);
+ wallet.SetAddressBook(r_key_dest, r_label.toStdString(), "receive");
+ wallet.SetAddressBook(s_key_dest, s_label.toStdString(), "send");
+ }
+
+ auto check_addbook_size = [&wallet](int expected_size) {
+ QCOMPARE(static_cast<int>(wallet.mapAddressBook.size()), expected_size);
+ };
+
+ // We should start with the two addresses we added earlier and nothing else.
+ check_addbook_size(2);
+
+ // Initialize relevant QT models.
+ std::unique_ptr<const PlatformStyle> platformStyle(PlatformStyle::instantiate("other"));
+ auto node = interfaces::MakeNode();
+ OptionsModel optionsModel(*node);
+ AddWallet(&wallet);
+ WalletModel walletModel(std::move(node->getWallets()[0]), *node, platformStyle.get(), &optionsModel);
+ RemoveWallet(&wallet);
+ EditAddressDialog editAddressDialog(EditAddressDialog::NewSendingAddress);
+ editAddressDialog.setModel(walletModel.getAddressTableModel());
+
+ EditAddressAndSubmit(
+ &editAddressDialog, QString("uhoh"), preexisting_r_address,
+ QString(
+ "Address \"%1\" already exists as a receiving address with label "
+ "\"%2\" and so cannot be added as a sending address."
+ ).arg(preexisting_r_address).arg(r_label));
+
+ check_addbook_size(2);
+
+ EditAddressAndSubmit(
+ &editAddressDialog, QString("uhoh, different"), preexisting_s_address,
+ QString(
+ "The entered address \"%1\" is already in the address book with "
+ "label \"%2\"."
+ ).arg(preexisting_s_address).arg(s_label));
+
+ check_addbook_size(2);
+
+ // Submit a new address which should add successfully - we expect the
+ // warning message to be blank.
+ EditAddressAndSubmit(
+ &editAddressDialog, QString("new"), new_address, QString(""));
+
+ check_addbook_size(3);
+}
+
+} // namespace
+
+void AddressBookTests::addressBookTests()
+{
+ TestAddAddressesToSendBook();
+}
diff --git a/src/qt/test/addressbooktests.h b/src/qt/test/addressbooktests.h
new file mode 100644
index 0000000000..beeb9e76a9
--- /dev/null
+++ b/src/qt/test/addressbooktests.h
@@ -0,0 +1,15 @@
+#ifndef BITCOIN_QT_TEST_ADDRESSBOOKTESTS_H
+#define BITCOIN_QT_TEST_ADDRESSBOOKTESTS_H
+
+#include <QObject>
+#include <QTest>
+
+class AddressBookTests : public QObject
+{
+ Q_OBJECT
+
+private Q_SLOTS:
+ void addressBookTests();
+};
+
+#endif // BITCOIN_QT_TEST_ADDRESSBOOKTESTS_H
diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp
index 25ee66dc6b..56d4d3e457 100644
--- a/src/qt/test/test_main.cpp
+++ b/src/qt/test/test_main.cpp
@@ -13,6 +13,7 @@
#include <qt/test/compattests.h>
#ifdef ENABLE_WALLET
+#include <qt/test/addressbooktests.h>
#include <qt/test/paymentservertests.h>
#include <qt/test/wallettests.h>
#endif
@@ -99,6 +100,10 @@ int main(int argc, char *argv[])
if (QTest::qExec(&test5) != 0) {
fInvalid = true;
}
+ AddressBookTests test6;
+ if (QTest::qExec(&test6) != 0) {
+ fInvalid = true;
+ }
#endif
fs::remove_all(pathTemp);
diff --git a/src/qt/test/util.cpp b/src/qt/test/util.cpp
new file mode 100644
index 0000000000..261caaaee5
--- /dev/null
+++ b/src/qt/test/util.cpp
@@ -0,0 +1,22 @@
+#include <qt/callback.h>
+
+#include <QApplication>
+#include <QMessageBox>
+#include <QTimer>
+#include <QString>
+#include <QPushButton>
+#include <QWidget>
+
+void ConfirmMessage(QString* text, int msec)
+{
+ QTimer::singleShot(msec, makeCallback([text](Callback* callback) {
+ for (QWidget* widget : QApplication::topLevelWidgets()) {
+ if (widget->inherits("QMessageBox")) {
+ QMessageBox* messageBox = qobject_cast<QMessageBox*>(widget);
+ if (text) *text = messageBox->text();
+ messageBox->defaultButton()->click();
+ }
+ }
+ delete callback;
+ }), SLOT(call()));
+}
diff --git a/src/qt/test/util.h b/src/qt/test/util.h
new file mode 100644
index 0000000000..324386c139
--- /dev/null
+++ b/src/qt/test/util.h
@@ -0,0 +1,12 @@
+#ifndef BITCOIN_QT_TEST_UTIL_H
+#define BITCOIN_QT_TEST_UTIL_H
+
+/**
+ * Press "Ok" button in message box dialog.
+ *
+ * @param text - Optionally store dialog text.
+ * @param msec - Number of miliseconds to pause before triggering the callback.
+ */
+void ConfirmMessage(QString* text = nullptr, int msec = 0);
+
+#endif // BITCOIN_QT_TEST_UTIL_H
diff --git a/src/qt/test/wallettests.cpp b/src/qt/test/wallettests.cpp
index 56d2d38194..a09d98dfe5 100644
--- a/src/qt/test/wallettests.cpp
+++ b/src/qt/test/wallettests.cpp
@@ -1,4 +1,5 @@
#include <qt/test/wallettests.h>
+#include <qt/test/util.h>
#include <interfaces/node.h>
#include <qt/bitcoinamountfield.h>
@@ -35,21 +36,6 @@
namespace
{
-//! Press "Ok" button in message box dialog.
-void ConfirmMessage(QString* text = nullptr)
-{
- QTimer::singleShot(0, makeCallback([text](Callback* callback) {
- for (QWidget* widget : QApplication::topLevelWidgets()) {
- if (widget->inherits("QMessageBox")) {
- QMessageBox* messageBox = qobject_cast<QMessageBox*>(widget);
- if (text) *text = messageBox->text();
- messageBox->defaultButton()->click();
- }
- }
- delete callback;
- }), SLOT(call()));
-}
-
//! Press "Yes" or "Cancel" buttons in modal send confirmation dialog.
void ConfirmSend(QString* text = nullptr, bool cancel = false)
{
@@ -264,7 +250,7 @@ void TestGUI()
QCOMPARE(requestTableModel->rowCount({}), currentRowCount-1);
}
-}
+} // namespace
void WalletTests::walletTests()
{
diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp
index f316c3ca45..2cb446c459 100644
--- a/src/qt/transactiondesc.cpp
+++ b/src/qt/transactiondesc.cpp
@@ -102,7 +102,7 @@ QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wall
if (IsValidDestination(address)) {
std::string name;
isminetype ismine;
- if (wallet.getAddress(address, &name, &ismine))
+ if (wallet.getAddress(address, &name, &ismine, /* purpose= */ nullptr))
{
strHTML += "<b>" + tr("From") + ":</b> " + tr("unknown") + "<br>";
strHTML += "<b>" + tr("To") + ":</b> ";
@@ -128,7 +128,8 @@ QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wall
strHTML += "<b>" + tr("To") + ":</b> ";
CTxDestination dest = DecodeDestination(strAddress);
std::string name;
- if (wallet.getAddress(dest, &name) && !name.empty())
+ if (wallet.getAddress(
+ dest, &name, /* is_mine= */ nullptr, /* purpose= */ nullptr) && !name.empty())
strHTML += GUIUtil::HtmlEscape(name) + " ";
strHTML += GUIUtil::HtmlEscape(strAddress) + "<br>";
}
@@ -196,7 +197,8 @@ QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wall
{
strHTML += "<b>" + tr("To") + ":</b> ";
std::string name;
- if (wallet.getAddress(address, &name) && !name.empty())
+ if (wallet.getAddress(
+ address, &name, /* is_mine= */ nullptr, /* purpose= */ nullptr) && !name.empty())
strHTML += GUIUtil::HtmlEscape(name) + " ";
strHTML += GUIUtil::HtmlEscape(EncodeDestination(address));
if(toSelf == ISMINE_SPENDABLE)
@@ -319,7 +321,7 @@ QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wall
if (ExtractDestination(vout.scriptPubKey, address))
{
std::string name;
- if (wallet.getAddress(address, &name) && !name.empty())
+ if (wallet.getAddress(address, &name, /* is_mine= */ nullptr, /* purpose= */ nullptr) && !name.empty())
strHTML += GUIUtil::HtmlEscape(name) + " ";
strHTML += QString::fromStdString(EncodeDestination(address));
}
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index 8f30a2a871..3418b1f1a9 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -274,7 +274,8 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction &tran
{
// Check if we have a new address or an updated label
std::string name;
- if (!m_wallet->getAddress(dest, &name))
+ if (!m_wallet->getAddress(
+ dest, &name, /* is_mine= */ nullptr, /* purpose= */ nullptr))
{
m_wallet->setAddressBook(dest, strLabel, "send");
}
diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h
index e5ed5b4e82..9173fcae52 100644
--- a/src/qt/walletmodel.h
+++ b/src/qt/walletmodel.h
@@ -204,6 +204,8 @@ public:
QString getWalletName() const;
bool isMultiwallet();
+
+ AddressTableModel* getAddressTableModel() const { return addressTableModel; }
private:
std::unique_ptr<interfaces::Wallet> m_wallet;
std::unique_ptr<interfaces::Handler> m_handler_status_changed;