Add tfMarket support to OfferCreate.

This commit is contained in:
Arthur Britto
2013-03-03 23:01:19 -08:00
parent 522d4f642a
commit 2bb4501553
2 changed files with 4 additions and 1 deletions

View File

@@ -321,6 +321,7 @@ TER OfferCreateTransactor::doApply()
cLog(lsWARNING) << "OfferCreate> " << mTxn.getJson(0);
const uint32 uTxFlags = mTxn.getFlags();
const bool bPassive = isSetBit(uTxFlags, tfPassive);
const bool bMarket = isSetBit(uTxFlags, tfMarket);
STAmount saTakerPays = mTxn.getFieldAmount(sfTakerPays);
STAmount saTakerGets = mTxn.getFieldAmount(sfTakerGets);
@@ -460,6 +461,7 @@ TER OfferCreateTransactor::doApply()
if (tesSUCCESS != terResult
|| !saTakerPays // Wants nothing more.
|| !saTakerGets // Offering nothing more.
|| bMarket // Do not persist.
|| !mEngine->getNodes().accountFunds(mTxnAccountID, saTakerGets).isPositive() // Not funded.
|| bUnfunded) // Consider unfunded.
{

View File

@@ -68,7 +68,8 @@ const uint32 tfAccountSetMask = ~(tfRequireDestTag|tfOptionalDestTag|tfRequireA
// OfferCreate flags:
const uint32 tfPassive = 0x00010000;
const uint32 tfOfferCreateMask = ~(tfPassive);
const uint32 tfMarket = 0x00020000;
const uint32 tfOfferCreateMask = ~(tfPassive|tfMarket);
// Payment flags:
const uint32 tfNoRippleDirect = 0x00010000;