Compare base addresses due to wallet2 integrated address inconsistency

This commit is contained in:
tobtoht 2022-07-26 18:59:17 +02:00
parent bfd51f383e
commit cfd85fac8a
No known key found for this signature in database
GPG key ID: 1CADD27F41F45C3C
4 changed files with 10 additions and 3 deletions

2
monero

@ -1 +1 @@
Subproject commit ed9996693aaa2c23206e43ca13b532aebc2cc2e7 Subproject commit 566e6e1904f20d7537c8f4c7f50caf1a5ee86bf8

View file

@ -667,11 +667,12 @@ void MainWindow::onCreateTransactionSuccess(PendingTransaction *tx, const QVecto
tx->refresh(); tx->refresh();
QSet<QString> outputAddresses; QSet<QString> outputAddresses;
for (const auto &output : tx->transaction(0)->outputs()) { for (const auto &output : tx->transaction(0)->outputs()) {
outputAddresses.insert(output->address()); outputAddresses.insert(WalletManager::baseAddressFromIntegratedAddress(output->address(), constants::networkType));
} }
QSet<QString> destAddresses; QSet<QString> destAddresses;
for (const auto &addr : address) { for (const auto &addr : address) {
destAddresses.insert(addr); // TODO: Monero core bug, integrated address is not added to dests for transactions spending ALL
destAddresses.insert(WalletManager::baseAddressFromIntegratedAddress(addr, constants::networkType));
} }
if (!outputAddresses.contains(destAddresses)) { if (!outputAddresses.contains(destAddresses)) {
err = QString("%1 %2").arg(err, "Constructed transaction doesn't appear to send to (all) specified destination address(es). Try creating the transaction again."); err = QString("%1 %2").arg(err, "Constructed transaction doesn't appear to send to (all) specified destination address(es). Try creating the transaction again.");

View file

@ -250,6 +250,11 @@ QString WalletManager::paymentIdFromAddress(const QString &address, NetworkType:
return QString::fromStdString(Monero::Wallet::paymentIdFromAddress(address.toStdString(), static_cast<Monero::NetworkType>(nettype))); return QString::fromStdString(Monero::Wallet::paymentIdFromAddress(address.toStdString(), static_cast<Monero::NetworkType>(nettype)));
} }
QString WalletManager::baseAddressFromIntegratedAddress(const QString &address, NetworkType::Type nettype)
{
return QString::fromStdString(Monero::Wallet::baseAddressFromIntegratedAddress(address.toStdString(), static_cast<Monero::NetworkType>(nettype))) ;
}
bool WalletManager::isDaemonLocal(const QString &daemon_address) const bool WalletManager::isDaemonLocal(const QString &daemon_address) const
{ {
return daemon_address.isEmpty() ? false : Monero::Utils::isAddressLocal(daemon_address.toStdString()); return daemon_address.isEmpty() ? false : Monero::Utils::isAddressLocal(daemon_address.toStdString());

View file

@ -98,6 +98,7 @@ public:
static bool keyValid(const QString &key, const QString &address, bool isViewKey, NetworkType::Type nettype); static bool keyValid(const QString &key, const QString &address, bool isViewKey, NetworkType::Type nettype);
QString paymentIdFromAddress(const QString &address, NetworkType::Type nettype) const; QString paymentIdFromAddress(const QString &address, NetworkType::Type nettype) const;
static QString baseAddressFromIntegratedAddress(const QString &address, NetworkType::Type nettype);
bool isDaemonLocal(const QString &daemon_address) const; bool isDaemonLocal(const QString &daemon_address) const;