mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
qt: Hide non PKHash-Addresses in signing address book
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <wallet/wallet.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <typeinfo>
|
||||
|
||||
#include <QFont>
|
||||
#include <QDebug>
|
||||
@@ -75,12 +76,14 @@ public:
|
||||
explicit AddressTablePriv(AddressTableModel *_parent):
|
||||
parent(_parent) {}
|
||||
|
||||
void refreshAddressTable(interfaces::Wallet& wallet)
|
||||
void refreshAddressTable(interfaces::Wallet& wallet, bool pk_hash_only = false)
|
||||
{
|
||||
cachedAddressTable.clear();
|
||||
{
|
||||
for (const auto& address : wallet.getAddresses())
|
||||
{
|
||||
if (pk_hash_only && address.dest.type() != typeid(PKHash))
|
||||
continue;
|
||||
AddressTableEntry::Type addressType = translateTransactionType(
|
||||
QString::fromStdString(address.purpose), address.is_mine);
|
||||
cachedAddressTable.append(AddressTableEntry(addressType,
|
||||
@@ -159,12 +162,12 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
AddressTableModel::AddressTableModel(WalletModel *parent) :
|
||||
AddressTableModel::AddressTableModel(WalletModel *parent, bool pk_hash_only) :
|
||||
QAbstractTableModel(parent), walletModel(parent)
|
||||
{
|
||||
columns << tr("Label") << tr("Address");
|
||||
priv = new AddressTablePriv(this);
|
||||
priv->refreshAddressTable(parent->wallet());
|
||||
priv->refreshAddressTable(parent->wallet(), pk_hash_only);
|
||||
}
|
||||
|
||||
AddressTableModel::~AddressTableModel()
|
||||
|
||||
Reference in New Issue
Block a user