Coins: manual input selection

This commit is contained in:
tobtoht
2022-03-20 23:30:48 +01:00
parent b8db796479
commit 3eb6d28221
13 changed files with 195 additions and 35 deletions
+11 -3
View File
@@ -82,9 +82,9 @@ void AppContext::onCreateTransaction(const QString &address, quint64 amount, con
qInfo() << "Creating transaction";
if (all)
this->wallet->createTransactionAllAsync(address, "", constants::mixin, this->tx_priority);
this->wallet->createTransactionAllAsync(address, "", constants::mixin, this->tx_priority, m_selectedInputs);
else
this->wallet->createTransactionAsync(address, "", amount, constants::mixin, this->tx_priority);
this->wallet->createTransactionAsync(address, "", amount, constants::mixin, this->tx_priority, m_selectedInputs);
emit initiateTransaction();
}
@@ -103,7 +103,7 @@ void AppContext::onCreateTransactionMultiDest(const QVector<QString> &addresses,
}
qInfo() << "Creating transaction";
this->wallet->createTransactionMultiDestAsync(addresses, amounts, this->tx_priority);
this->wallet->createTransactionMultiDestAsync(addresses, amounts, this->tx_priority, m_selectedInputs);
emit initiateTransaction();
}
@@ -131,6 +131,9 @@ void AppContext::onCancelTransaction(PendingTransaction *tx, const QVector<QStri
}
void AppContext::commitTransaction(PendingTransaction *tx, const QString &description) {
// Clear list of selected transfers
this->setSelectedInputs({});
// Nodes - even well-connected, properly configured ones - consistently fail to relay transactions
// To mitigate transactions failing we just send the transaction to every node we know about over Tor
if (config()->get(Config::multiBroadcast).toBool()) {
@@ -180,6 +183,11 @@ void AppContext::onDeviceError(const QString &message) {
// ################## Misc ##################
void AppContext::setSelectedInputs(const QStringList &selectedInputs) {
m_selectedInputs = selectedInputs;
emit selectedInputsChanged(selectedInputs);
}
void AppContext::onTorSettingsChanged() {
if (Utils::isTorsocks()) {
return;