mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-03 16:02:34 +02:00
GUI: WalletModel: Wrap checkAddressForUsage and findAddressUsage
This commit is contained in:
parent
cd213eca16
commit
178605b413
@ -155,6 +155,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;
|
||||
|
@ -10,12 +10,14 @@
|
||||
#endif
|
||||
|
||||
#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>
|
||||
@ -85,6 +87,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