From 433fb7185d2f9742995a2b9b1ca0aea803d420d3 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Tue, 8 Jan 2019 13:20:01 -0800 Subject: [PATCH] #62 - Add check for negative amounts --- res/zec_qt_wallet_de.ts | 5 +++++ res/zec_qt_wallet_es.ts | 5 +++++ res/zec_qt_wallet_fr.ts | 5 +++++ res/zec_qt_wallet_pt.ts | 5 +++++ src/sendtab.cpp | 7 +++++++ 5 files changed, 27 insertions(+) diff --git a/res/zec_qt_wallet_de.ts b/res/zec_qt_wallet_de.ts index 1708cfa..2e38021 100644 --- a/res/zec_qt_wallet_de.ts +++ b/res/zec_qt_wallet_de.ts @@ -643,6 +643,11 @@ doesn't look like a z-address is Invalid YOUR_TRANSLATION_HERE + + + Amount '%1' is invalid! + + MemoDialog diff --git a/res/zec_qt_wallet_es.ts b/res/zec_qt_wallet_es.ts index 15fa050..06a4518 100644 --- a/res/zec_qt_wallet_es.ts +++ b/res/zec_qt_wallet_es.ts @@ -643,6 +643,11 @@ doesn't look like a z-address is Invalid es Inválida + + + Amount '%1' is invalid! + + MemoDialog diff --git a/res/zec_qt_wallet_fr.ts b/res/zec_qt_wallet_fr.ts index 7a32fff..091dffa 100644 --- a/res/zec_qt_wallet_fr.ts +++ b/res/zec_qt_wallet_fr.ts @@ -646,6 +646,11 @@ Cette adresse ne semble pas être de type adresse-z is Invalid est invalide + + + Amount '%1' is invalid! + + MemoDialog diff --git a/res/zec_qt_wallet_pt.ts b/res/zec_qt_wallet_pt.ts index 8c58a73..a0cd396 100644 --- a/res/zec_qt_wallet_pt.ts +++ b/res/zec_qt_wallet_pt.ts @@ -645,6 +645,11 @@ não se parece com um z-Address is Invalid é Inválido + + + Amount '%1' is invalid! + + MemoDialog diff --git a/src/sendtab.cpp b/src/sendtab.cpp index a273845..5c1364d 100644 --- a/src/sendtab.cpp +++ b/src/sendtab.cpp @@ -643,8 +643,15 @@ QString MainWindow::doSendTxValidations(Tx tx) { QString addr = (toAddr.addr.length() > 100 ? toAddr.addr.left(100) + "..." : toAddr.addr); return QString(tr("Recipient Address ")) % addr % tr(" is Invalid"); } + + // This technically shouldn't be possible, but issue #62 seems to have discovered a bug + // somewhere, so just add a check to make sure. + if (toAddr.amount < 0) { + return QString(tr("Amount '%1' is invalid!").arg(toAddr.amount)); + } } + return QString(); }