fix rounding problem
This commit is contained in:
@@ -320,7 +320,9 @@ void RPC::fillTxJsonParams(json& params, Tx tx) {
|
|||||||
// Construct the JSON params
|
// Construct the JSON params
|
||||||
json rec = json::object();
|
json rec = json::object();
|
||||||
rec["address"] = toAddr.addr.toStdString();
|
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())
|
if (toAddr.addr.startsWith("z") && !toAddr.encodedMemo.trimmed().isEmpty())
|
||||||
rec["memo"] = toAddr.encodedMemo.toStdString();
|
rec["memo"] = toAddr.encodedMemo.toStdString();
|
||||||
|
|
||||||
|
|||||||
@@ -312,7 +312,6 @@ void Turnstile::executeMigrationStep() {
|
|||||||
nextStep->status = TurnstileMigrationItemStatus::SentToT;
|
nextStep->status = TurnstileMigrationItemStatus::SentToT;
|
||||||
writeMigrationPlan(plan);
|
writeMigrationPlan(plan);
|
||||||
});
|
});
|
||||||
|
|
||||||
} else if (nextStep->status == TurnstileMigrationItemStatus::SentToT) {
|
} else if (nextStep->status == TurnstileMigrationItemStatus::SentToT) {
|
||||||
// First thing to do is check to see if the funds are confirmed.
|
// 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.
|
// We'll check both the original sprout address and the intermediate t-addr for safety.
|
||||||
|
|||||||
Reference in New Issue
Block a user