diff --git a/src/ripple_app/ledger/Ledger.cpp b/src/ripple_app/ledger/Ledger.cpp index a2c894891b..7173ea5efc 100644 --- a/src/ripple_app/ledger/Ledger.cpp +++ b/src/ripple_app/ledger/Ledger.cpp @@ -1873,12 +1873,12 @@ std::set Ledger::getPendingSaves() return sPendingSaves; } -void Ledger::ownerDirDescriber (SLE::ref sle, const uint160& owner) +void Ledger::ownerDirDescriber (SLE::ref sle, bool, const uint160& owner) { sle->setFieldAccount (sfOwner, owner); } -void Ledger::qualityDirDescriber (SLE::ref sle, +void Ledger::qualityDirDescriber (SLE::ref sle, bool, const uint160& uTakerPaysCurrency, const uint160& uTakerPaysIssuer, const uint160& uTakerGetsCurrency, const uint160& uTakerGetsIssuer, const uint64& uRate) diff --git a/src/ripple_app/ledger/Ledger.h b/src/ripple_app/ledger/Ledger.h index 2bce4768f3..b4836d6eb5 100644 --- a/src/ripple_app/ledger/Ledger.h +++ b/src/ripple_app/ledger/Ledger.h @@ -364,7 +364,7 @@ public: // Given a directory root and and index compute the index of a node. static uint256 getDirNodeIndex (uint256 const & uDirRoot, const uint64 uNodeIndex = 0); - static void ownerDirDescriber (SLE::ref, const uint160 & owner); + static void ownerDirDescriber (SLE::ref, bool, const uint160 & owner); // Return a node: root or normal SLE::pointer getDirNode (uint256 const & uNodeIndex); @@ -376,7 +376,7 @@ public: static uint256 getQualityIndex (uint256 const & uBase, const uint64 uNodeDir = 0); static uint256 getQualityNext (uint256 const & uBase); static uint64 getQuality (uint256 const & uBase); - static void qualityDirDescriber (SLE::ref, + static void qualityDirDescriber (SLE::ref, bool, const uint160 & uTakerPaysCurrency, const uint160 & uTakerPaysIssuer, const uint160 & uTakerGetsCurrency, const uint160 & uTakerGetsIssuer, const uint64 & uRate); diff --git a/src/ripple_app/ledger/LedgerEntrySet.cpp b/src/ripple_app/ledger/LedgerEntrySet.cpp index 7ce418e67a..8b691c37b8 100644 --- a/src/ripple_app/ledger/LedgerEntrySet.cpp +++ b/src/ripple_app/ledger/LedgerEntrySet.cpp @@ -625,10 +625,10 @@ TER LedgerEntrySet::dirCount (uint256 const& uRootIndex, uint32& uCount) // Only append. This allow for things that watch append only structure to just monitor from the last node on ward. // Within a node with no deletions order of elements is sequential. Otherwise, order of elements is random. TER LedgerEntrySet::dirAdd ( - uint64& uNodeDir, - uint256 const& uRootIndex, - uint256 const& uLedgerIndex, - FUNCTION_TYPE fDescriber) + uint64& uNodeDir, + uint256 const& uRootIndex, + uint256 const& uLedgerIndex, + FUNCTION_TYPE fDescriber) { WriteLog (lsTRACE, LedgerEntrySet) << boost::str (boost::format ("dirAdd: uRootIndex=%s uLedgerIndex=%s") % uRootIndex.ToString () @@ -643,7 +643,7 @@ TER LedgerEntrySet::dirAdd ( // No root, make it. sleRoot = entryCreate (ltDIR_NODE, uRootIndex); sleRoot->setFieldH256 (sfRootIndex, uRootIndex); - fDescriber (sleRoot); + fDescriber (sleRoot, true); sleNode = sleRoot; uNodeDir = 0; @@ -694,7 +694,7 @@ TER LedgerEntrySet::dirAdd ( if (uNodeDir != 1) sleNode->setFieldU64 (sfIndexPrevious, uNodeDir - 1); - fDescriber (sleNode); + fDescriber (sleNode, false); svIndexes = STVector256 (); } @@ -1350,7 +1350,7 @@ TER LedgerEntrySet::trustCreate ( uLowNode, Ledger::getOwnerDirIndex (uLowAccountID), sleRippleState->getIndex (), - BIND_TYPE (&Ledger::ownerDirDescriber, P_1, uLowAccountID)); + BIND_TYPE (&Ledger::ownerDirDescriber, P_1, P_2, uLowAccountID)); if (tesSUCCESS == terResult) { @@ -1358,7 +1358,7 @@ TER LedgerEntrySet::trustCreate ( uHighNode, Ledger::getOwnerDirIndex (uHighAccountID), sleRippleState->getIndex (), - BIND_TYPE (&Ledger::ownerDirDescriber, P_1, uHighAccountID)); + BIND_TYPE (&Ledger::ownerDirDescriber, P_1, P_2, uHighAccountID)); } if (tesSUCCESS == terResult) diff --git a/src/ripple_app/ledger/LedgerEntrySet.h b/src/ripple_app/ledger/LedgerEntrySet.h index 236c4af3eb..5573c99d6a 100644 --- a/src/ripple_app/ledger/LedgerEntrySet.h +++ b/src/ripple_app/ledger/LedgerEntrySet.h @@ -147,7 +147,7 @@ public: uint64 & uNodeDir, // Node of entry. uint256 const & uRootIndex, uint256 const & uLedgerIndex, - FUNCTION_TYPE fDescriber); + FUNCTION_TYPE fDescriber); TER dirDelete ( const bool bKeepRoot, diff --git a/src/ripple_app/tx/OfferCreateTransactor.cpp b/src/ripple_app/tx/OfferCreateTransactor.cpp index 5803f4f68d..351afd3517 100644 --- a/src/ripple_app/tx/OfferCreateTransactor.cpp +++ b/src/ripple_app/tx/OfferCreateTransactor.cpp @@ -637,7 +637,7 @@ TER OfferCreateTransactor::doApply () // Add offer to owner's directory. terResult = lesActive.dirAdd (uOwnerNode, Ledger::getOwnerDirIndex (mTxnAccountID), uLedgerIndex, - BIND_TYPE (&Ledger::ownerDirDescriber, P_1, mTxnAccountID)); + BIND_TYPE (&Ledger::ownerDirDescriber, P_1, P_2, mTxnAccountID)); if (tesSUCCESS == terResult) @@ -657,7 +657,8 @@ TER OfferCreateTransactor::doApply () // Add offer to order book. terResult = lesActive.dirAdd (uBookNode, uDirectory, uLedgerIndex, - BIND_TYPE (&Ledger::qualityDirDescriber, P_1, saTakerPays.getCurrency (), uPaysIssuerID, + BIND_TYPE (&Ledger::qualityDirDescriber, P_1, P_2, + saTakerPays.getCurrency (), uPaysIssuerID, saTakerGets.getCurrency (), uGetsIssuerID, uRate)); }