Make sure finally negative offers are not processed.

This commit is contained in:
Arthur Britto
2013-03-04 13:56:40 -08:00
parent 35da5d5945
commit dd398b7eb9
3 changed files with 17 additions and 2 deletions

View File

@@ -458,8 +458,19 @@ TER OfferCreateTransactor::doApply()
// cLog(lsWARNING) << "OfferCreate: takeOffers: uPaysIssuerID=" << RippleAddress::createHumanAccountID(uPaysIssuerID);
// cLog(lsWARNING) << "OfferCreate: takeOffers: uGetsIssuerID=" << RippleAddress::createHumanAccountID(uGetsIssuerID);
if (tesSUCCESS != terResult
|| !saTakerPays // Wants nothing more.
if (tesSUCCESS != terResult)
{
// Fail as is.
nothing();
}
else if (saTakerPays.isNegative() || saTakerGets.isNegative())
{
terResult = isSetBit(mParams, tapOPEN_LEDGER)
? telFAILED_PROCESSING // Ledger is not final, can vote no.
: tecFAILED_PROCESSING;
}
else if (
!saTakerPays // Wants nothing more.
|| !saTakerGets // Offering nothing more.
|| bMarket // Do not persist.
|| !mEngine->getNodes().accountFunds(mTxnAccountID, saTakerGets).isPositive() // Not funded.