#62 - Add check for negative amounts

This commit is contained in:
Aditya Kulkarni
2019-01-08 13:20:01 -08:00
parent c9c06ff81f
commit 433fb7185d
5 changed files with 27 additions and 0 deletions

View File

@@ -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();
}