Browse Source

check for funds before spread notes

pull/139/head
Deniod 4 months ago
parent
commit
c6e8268450
  1. 6
      src/controller.cpp

6
src/controller.cpp

@ -187,9 +187,10 @@ void Controller::fillTxJsonParams(json& allRecepients, Tx tx)
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
for (size_t i = 0; i < dust.size(); ++i) {
// Generate random memo
@ -1523,7 +1524,6 @@ void Controller::executeStandardUITransaction(Tx tx)
);
}
// Execute a transaction!
void Controller::executeTransaction(Tx tx,
const std::function<void(QString txid)> submitted,

Loading…
Cancel
Save