check for funds before spread notes
This commit is contained in:
@@ -187,9 +187,10 @@ void Controller::fillTxJsonParams(json& allRecepients, Tx tx)
|
|||||||
dust.at(i)["memo"] = randomString.toStdString();
|
dust.at(i)["memo"] = randomString.toStdString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
CAmount balanceAvailable = getModel()->getBalVerified();
|
||||||
// Create more Notes if spendableNotesCount < 30
|
|
||||||
if (spendableNotesCount < 30) {
|
// Create more Notes if spendableNotesCount < 30 and enough funds are available
|
||||||
|
if (spendableNotesCount < 30 || balanceAvailable.toDecimalhushString().toDouble() > (dust.size() * 0.0001)) {
|
||||||
// Create extra transaction
|
// Create extra transaction
|
||||||
for (size_t i = 0; i < dust.size(); ++i) {
|
for (size_t i = 0; i < dust.size(); ++i) {
|
||||||
// Generate random memo
|
// Generate random memo
|
||||||
@@ -218,7 +219,7 @@ void Controller::fillTxJsonParams(json& allRecepients, Tx tx)
|
|||||||
rec["amount"] = toAddr.amount.toqint64();
|
rec["amount"] = toAddr.amount.toqint64();
|
||||||
if (Settings::isZAddress(toAddr.addr) && !toAddr.memo.trimmed().isEmpty())
|
if (Settings::isZAddress(toAddr.addr) && !toAddr.memo.trimmed().isEmpty())
|
||||||
rec["memo"] = toAddr.memo.toStdString();
|
rec["memo"] = toAddr.memo.toStdString();
|
||||||
}
|
}
|
||||||
|
|
||||||
allRecepients.push_back(rec);
|
allRecepients.push_back(rec);
|
||||||
|
|
||||||
@@ -1523,7 +1524,6 @@ void Controller::executeStandardUITransaction(Tx tx)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Execute a transaction!
|
// Execute a transaction!
|
||||||
void Controller::executeTransaction(Tx tx,
|
void Controller::executeTransaction(Tx tx,
|
||||||
const std::function<void(QString txid)> submitted,
|
const std::function<void(QString txid)> submitted,
|
||||||
|
|||||||
Reference in New Issue
Block a user