forked from Public/monero-gui
Transfer: validate destination address
including preventing two payment ids (standalone and from integrated address)
This commit is contained in:
@@ -154,6 +154,16 @@ bool WalletManager::paymentIdValid(const QString &payment_id) const
|
||||
return Bitmonero::Wallet::paymentIdValid(payment_id.toStdString());
|
||||
}
|
||||
|
||||
bool WalletManager::addressValid(const QString &address, bool testnet) const
|
||||
{
|
||||
return Bitmonero::Wallet::addressValid(address.toStdString(), testnet);
|
||||
}
|
||||
|
||||
QString WalletManager::paymentIdFromAddress(const QString &address, bool testnet) const
|
||||
{
|
||||
return QString::fromStdString(Bitmonero::Wallet::paymentIdFromAddress(address.toStdString(), testnet));
|
||||
}
|
||||
|
||||
void WalletManager::setLogLevel(int logLevel)
|
||||
{
|
||||
Bitmonero::WalletManagerFactory::setLogLevel(logLevel);
|
||||
|
||||
@@ -90,6 +90,8 @@ public:
|
||||
Q_INVOKABLE QString maximumAllowedAmountAsSting() const;
|
||||
|
||||
Q_INVOKABLE bool paymentIdValid(const QString &payment_id) const;
|
||||
Q_INVOKABLE bool addressValid(const QString &address, bool testnet) const;
|
||||
Q_INVOKABLE QString paymentIdFromAddress(const QString &address, bool testnet) const;
|
||||
|
||||
// QML missing such functionality, implementing these helpers here
|
||||
Q_INVOKABLE QString urlToLocalPath(const QUrl &url) const;
|
||||
|
||||
Reference in New Issue
Block a user