From cba4b820912769f4ce5df1e73abebb1b620dcd94 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Mon, 1 Oct 2012 12:16:59 -0700 Subject: [PATCH] Don't allow offer amounts to be negative. --- src/TransactionAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TransactionAction.cpp b/src/TransactionAction.cpp index 9c4cf6a1d..190a66bb3 100644 --- a/src/TransactionAction.cpp +++ b/src/TransactionAction.cpp @@ -758,7 +758,7 @@ TER TransactionEngine::takeOffers( else { // Have an offer directory to consider. - Log(lsINFO) << "takeOffers: considering dir : " << sleOfferDir->getJson(0); + Log(lsINFO) << "takeOffers: considering dir: " << sleOfferDir->getJson(0); SLE::pointer sleBookNode; unsigned int uBookEntry; @@ -965,7 +965,7 @@ Log(lsINFO) << boost::str(boost::format("doOfferCreate: saTakerPays=%s saTakerGe terResult = temBAD_OFFER; } - else if (!saTakerPays || !saTakerGets) + else if (!saTakerPays.isPositive() || !saTakerGets.isPositive()) { Log(lsWARNING) << "doOfferCreate: Malformed offer: bad amount";