From dfff2c61d1b4a812d75e2f817e0d5c6aa4407345 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Wed, 10 Oct 2012 22:12:56 -0700 Subject: [PATCH] Transaction engine makes sure max send is positive. --- src/TransactionAction.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/TransactionAction.cpp b/src/TransactionAction.cpp index 35ed8397d..619a932bc 100644 --- a/src/TransactionAction.cpp +++ b/src/TransactionAction.cpp @@ -504,9 +504,15 @@ TER TransactionEngine::doPayment(const SerializedTransaction& txn, const Transac return temDST_NEEDED; } + else if (bMax && !saMaxAmount.isPositive()) + { + Log(lsINFO) << "doPayment: Invalid transaction: bad max amount: " << saMaxAmount.getFullText(); + + return temBAD_AMOUNT; + } else if (!saDstAmount.isPositive()) { - Log(lsINFO) << "doPayment: Invalid transaction: bad amount: " << saDstAmount.getHumanCurrency() << " " << saDstAmount.getText(); + Log(lsINFO) << "doPayment: Invalid transaction: bad dst amount: " << saDstAmount.getFullText(); return temBAD_AMOUNT; }