mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-08-04 14:04:49 +02:00
GUI: WalletModel: Wrap checkAddressForUsage and findAddressUsage
This commit is contained in:
parent
0ba948aa4f
commit
42e4f13246
@ -151,6 +151,22 @@ bool WalletModel::validateAddress(const QString& address) const
|
||||
return IsValidDestinationString(address.toStdString());
|
||||
}
|
||||
|
||||
bool WalletModel::checkAddressForUsage(const std::vector<std::string>& addresses) const
|
||||
{
|
||||
return m_wallet->checkAddressForUsage(addresses);
|
||||
}
|
||||
|
||||
bool WalletModel::findAddressUsage(const QStringList& addresses, std::function<void(const QString&, const interfaces::WalletTx&, uint32_t)> callback) const
|
||||
{
|
||||
std::vector<std::string> std_addresses;
|
||||
for (const auto& address : addresses) {
|
||||
std_addresses.push_back(address.toStdString());
|
||||
}
|
||||
return m_wallet->findAddressUsage(std_addresses, [&callback](const std::string& address, const interfaces::WalletTx& wtx, uint32_t output_index){
|
||||
callback(QString::fromStdString(address), wtx, output_index);
|
||||
});
|
||||
}
|
||||
|
||||
WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransaction &transaction, const CCoinControl& coinControl)
|
||||
{
|
||||
CAmount total = 0;
|
||||
|
@ -6,12 +6,14 @@
|
||||
#define BITCOIN_QT_WALLETMODEL_H
|
||||
|
||||
#include <key.h>
|
||||
#include <primitives/transaction.h>
|
||||
|
||||
#include <qt/walletmodeltransaction.h>
|
||||
|
||||
#include <interfaces/wallet.h>
|
||||
#include <support/allocators/secure.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <QObject>
|
||||
@ -81,6 +83,8 @@ public:
|
||||
|
||||
// Check address for validity
|
||||
bool validateAddress(const QString& address) const;
|
||||
bool checkAddressForUsage(const std::vector<std::string>& addresses) const;
|
||||
bool findAddressUsage(const QStringList& addresses, std::function<void(const QString&, const interfaces::WalletTx&, uint32_t)> callback) const;
|
||||
|
||||
// Return status record for SendCoins, contains error id + information
|
||||
struct SendCoinsReturn
|
||||
|
Loading…
Reference in New Issue
Block a user