Wallet: fix transfer with Qt 5.12

This commit is contained in:
selsta 2021-04-13 07:27:05 +02:00
parent 816eeb4647
commit f53af12e02
No known key found for this signature in database
GPG key ID: 2EA0A99A8B07AE5E
3 changed files with 12 additions and 8 deletions

View file

@ -885,7 +885,7 @@ ApplicationWindow {
return recipient.address;
});
const amountsxmr = recipients.map(function (recipient) {
return walletManager.amountFromString(recipient.amount);
return recipient.amount;
});
currentWallet.createTransactionAsync(addresses, paymentId, amountsxmr, mixinCount, priority);
}

View file

@ -535,7 +535,7 @@ void Wallet::pauseRefresh()
PendingTransaction *Wallet::createTransaction(
const QVector<QString> &destinationAddresses,
const QString &payment_id,
const QVector<quint64> &amounts,
const QVector<QString> &destinationAmounts,
quint32 mixin_count,
PendingTransaction::Priority priority)
{
@ -543,11 +543,15 @@ PendingTransaction *Wallet::createTransaction(
for (const auto &address : destinationAddresses) {
destinations.push_back(address.toStdString());
}
std::vector<uint64_t> amounts;
for (const auto &amount : destinationAmounts) {
amounts.push_back(Monero::Wallet::amountFromString(amount.toStdString()));
}
std::set<uint32_t> subaddr_indices;
Monero::PendingTransaction *ptImpl = m_walletImpl->createTransactionMultDest(
destinations,
payment_id.toStdString(),
std::vector<uint64_t>(amounts.begin(), amounts.end()),
amounts,
mixin_count,
static_cast<Monero::PendingTransaction::Priority>(priority),
currentSubaddressAccount(),
@ -559,12 +563,12 @@ PendingTransaction *Wallet::createTransaction(
void Wallet::createTransactionAsync(
const QVector<QString> &destinationAddresses,
const QString &payment_id,
const QVector<quint64> &amounts,
const QVector<QString> &destinationAmounts,
quint32 mixin_count,
PendingTransaction::Priority priority)
{
m_scheduler.run([this, destinationAddresses, payment_id, amounts, mixin_count, priority] {
PendingTransaction *tx = createTransaction(destinationAddresses, payment_id, amounts, mixin_count, priority);
m_scheduler.run([this, destinationAddresses, payment_id, destinationAmounts, mixin_count, priority] {
PendingTransaction *tx = createTransaction(destinationAddresses, payment_id, destinationAmounts, mixin_count, priority);
emit transactionCreated(tx, destinationAddresses, payment_id, mixin_count);
});
}

View file

@ -220,7 +220,7 @@ public:
Q_INVOKABLE void createTransactionAsync(
const QVector<QString> &destinationAddresses,
const QString &payment_id,
const QVector<quint64> &amounts,
const QVector<QString> &destinationAmounts,
quint32 mixin_count,
PendingTransaction::Priority priority);
@ -421,7 +421,7 @@ private:
PendingTransaction *createTransaction(
const QVector<QString> &destinationAddresses,
const QString &payment_id,
const QVector<quint64> &amounts,
const QVector<QString> &destinationAmounts,
quint32 mixin_count,
PendingTransaction::Priority priority);