From 276f6f4da15d433568eb3bdc886a472ea8d1939d Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Fri, 20 Jul 2012 15:23:32 -0700 Subject: [PATCH] Change sfDirectory to sfBookDirectory. --- src/LedgerFormats.cpp | 2 +- src/SerializedObject.h | 2 +- src/TransactionEngine.cpp | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/LedgerFormats.cpp b/src/LedgerFormats.cpp index e1ad188de8..20f49943fe 100644 --- a/src/LedgerFormats.cpp +++ b/src/LedgerFormats.cpp @@ -48,7 +48,7 @@ LedgerEntryFormat LedgerFormats[]= { S_FIELD(Sequence), STI_UINT32, SOE_REQUIRED, 0 }, { S_FIELD(TakerPays), STI_AMOUNT, SOE_REQUIRED, 0 }, { S_FIELD(TakerGets), STI_AMOUNT, SOE_REQUIRED, 0 }, - { S_FIELD(Directory), STI_HASH256, SOE_REQUIRED, 0 }, + { S_FIELD(BookDirectory), STI_HASH256, SOE_REQUIRED, 0 }, { S_FIELD(BookNode), STI_UINT64, SOE_REQUIRED, 0 }, { S_FIELD(OwnerNode), STI_UINT64, SOE_REQUIRED, 0 }, { S_FIELD(PaysIssuer), STI_ACCOUNT, SOE_IFFLAG, 1 }, diff --git a/src/SerializedObject.h b/src/SerializedObject.h index 884a492e18..be1bd051bc 100644 --- a/src/SerializedObject.h +++ b/src/SerializedObject.h @@ -32,6 +32,7 @@ enum SOE_Field sfAmount, sfAuthorizedKey, sfBalance, + sfBookDirectory, sfBookNode, sfBorrowExpire, sfBorrowRate, @@ -42,7 +43,6 @@ enum SOE_Field sfCurrencyIn, sfCurrencyOut, sfDestination, - sfDirectory, sfDomain, sfEmailHash, sfExpiration, diff --git a/src/TransactionEngine.cpp b/src/TransactionEngine.cpp index e387d0fd3c..bb42e2a234 100644 --- a/src/TransactionEngine.cpp +++ b/src/TransactionEngine.cpp @@ -306,11 +306,11 @@ STAmount TransactionEngine::accountSend(const uint160& uSenderID, const uint160& TransactionEngineResult TransactionEngine::offerDelete(const SLE::pointer& sleOffer, const uint256& uOfferIndex, const uint160& uOwnerID) { uint64 uOwnerNode = sleOffer->getIFieldU64(sfOwnerNode); - TransactionEngineResult terResult = dirDelete(true, uOwnerNode, Ledger::getOwnerDirIndex(uOwnerID), uOfferIndex); + TransactionEngineResult terResult = dirDelete(false, uOwnerNode, Ledger::getOwnerDirIndex(uOwnerID), uOfferIndex); if (terSUCCESS == terResult) { - uint256 uDirectory = sleOffer->getIFieldH256(sfDirectory); + uint256 uDirectory = sleOffer->getIFieldH256(sfBookDirectory); uint64 uBookNode = sleOffer->getIFieldU64(sfBookNode); terResult = dirDelete(false, uBookNode, uDirectory, uOfferIndex); @@ -1360,7 +1360,7 @@ TransactionEngineResult TransactionEngine::doCreditSet(const SerializedTransacti // Zero balance and eliminating last limit. bDelIndex = true; - terResult = dirDelete(true, uSrcRef, Ledger::getRippleDirIndex(mTxnAccountID), sleRippleState->getIndex()); + terResult = dirDelete(false, uSrcRef, Ledger::getRippleDirIndex(mTxnAccountID), sleRippleState->getIndex()); } } #endif @@ -1957,6 +1957,7 @@ TransactionEngineResult TransactionEngine::doInvoice(const SerializedTransaction // <-- saTakerGot: What taker got not including fees. To reduce an offer. // <-- terResult: terSUCCESS or terNO_ACCOUNT // Note: All SLE modifications must always occur even on failure. +// XXX: Fees should be paid by the source of the currency. TransactionEngineResult TransactionEngine::takeOffers( bool bPassive, const uint256& uBookBase, @@ -2320,7 +2321,7 @@ Log(lsWARNING) << "doOfferCreate: saTakerGets=" << saTakerGets.getFullText(); sleOffer->setIFieldAccount(sfAccount, mTxnAccountID); sleOffer->setIFieldU32(sfSequence, uSequence); - sleOffer->setIFieldH256(sfDirectory, uDirectory); + sleOffer->setIFieldH256(sfBookDirectory, uDirectory); sleOffer->setIFieldAmount(sfTakerPays, saTakerPays); sleOffer->setIFieldAmount(sfTakerGets, saTakerGets); sleOffer->setIFieldU64(sfOwnerNode, uOwnerNode);