diff --git a/src/rpc.cpp b/src/rpc.cpp index 318153b..829d9b9 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -320,7 +320,9 @@ void RPC::fillTxJsonParams(json& params, Tx tx) { // Construct the JSON params json rec = json::object(); rec["address"] = toAddr.addr.toStdString(); - rec["amount"] = toAddr.amount; + // Force it through string for rounding. Without this, decimal points beyond 8 places + // will appear, causing an "invalid amount" error + rec["amount"] = QString::number(toAddr.amount, 'f', 8).toDouble(); if (toAddr.addr.startsWith("z") && !toAddr.encodedMemo.trimmed().isEmpty()) rec["memo"] = toAddr.encodedMemo.toStdString(); diff --git a/src/turnstile.cpp b/src/turnstile.cpp index 51aa49c..13e3d40 100644 --- a/src/turnstile.cpp +++ b/src/turnstile.cpp @@ -312,7 +312,6 @@ void Turnstile::executeMigrationStep() { nextStep->status = TurnstileMigrationItemStatus::SentToT; writeMigrationPlan(plan); }); - } else if (nextStep->status == TurnstileMigrationItemStatus::SentToT) { // First thing to do is check to see if the funds are confirmed. // We'll check both the original sprout address and the intermediate t-addr for safety. diff --git a/src/turnstile.h b/src/turnstile.h index aba1a3e..dfa5dae 100644 --- a/src/turnstile.h +++ b/src/turnstile.h @@ -45,19 +45,19 @@ public: void fillAmounts(QList& amounts, double amount, int count); QList readMigrationPlan(); - void writeMigrationPlan(QList plan); - void removeFile(); + void writeMigrationPlan(QList plan); + void removeFile(); - void executeMigrationStep(); - ProgressReport getPlanProgress(); - bool isMigrationPresent(); + void executeMigrationStep(); + ProgressReport getPlanProgress(); + bool isMigrationPresent(); - static double minMigrationAmount; + static double minMigrationAmount; private: - QList getBlockNumbers(int start, int end, int count); - QString writeableFile(); + QList getBlockNumbers(int start, int end, int count); + QString writeableFile(); - void doSendTx(Tx tx, std::function cb); + void doSendTx(Tx tx, std::function cb); QList::Iterator getNextStep(QList& plan);