fix rounding problem
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -45,19 +45,19 @@ public:
|
||||
void fillAmounts(QList<double>& amounts, double amount, int count);
|
||||
|
||||
QList<TurnstileMigrationItem> readMigrationPlan();
|
||||
void writeMigrationPlan(QList<TurnstileMigrationItem> plan);
|
||||
void removeFile();
|
||||
void writeMigrationPlan(QList<TurnstileMigrationItem> plan);
|
||||
void removeFile();
|
||||
|
||||
void executeMigrationStep();
|
||||
ProgressReport getPlanProgress();
|
||||
bool isMigrationPresent();
|
||||
void executeMigrationStep();
|
||||
ProgressReport getPlanProgress();
|
||||
bool isMigrationPresent();
|
||||
|
||||
static double minMigrationAmount;
|
||||
static double minMigrationAmount;
|
||||
private:
|
||||
QList<int> getBlockNumbers(int start, int end, int count);
|
||||
QString writeableFile();
|
||||
QList<int> getBlockNumbers(int start, int end, int count);
|
||||
QString writeableFile();
|
||||
|
||||
void doSendTx(Tx tx, std::function<void(void)> cb);
|
||||
void doSendTx(Tx tx, std::function<void(void)> cb);
|
||||
|
||||
|
||||
QList<TurnstileMigrationItem>::Iterator getNextStep(QList<TurnstileMigrationItem>& plan);
|
||||
|
||||
Reference in New Issue
Block a user