You can now create a LedgerEntrySet without a TransactionEngine. You can

call all the various entry* functions on it directly. You can throw it out
when you're done. The constructor is:

    LedgerEntrySet(Ledger::ref ledger)

All the normal checkpointing, caching, and swapping will work. Of course,
you cannot commit the results. The TransactionEngine::entry* functions now
just directly call the corresponding functions on the LedgerEntrySet. You
can call them in code that will only be used in the context of a
transaction.
This commit is contained in:
JoelKatz
2012-09-08 00:48:26 -07:00
parent 63921c9757
commit 1a1952ea7b
4 changed files with 55 additions and 68 deletions

View File

@@ -308,10 +308,10 @@ protected:
// If the transaction fails to meet some constraint, still need to delete unfunded offers.
boost::unordered_set<uint256> musUnfundedFound; // Offers that were found unfunded.
SLE::pointer entryCreate(LedgerEntryType letType, const uint256& uIndex);
SLE::pointer entryCache(LedgerEntryType letType, const uint256& uIndex);
void entryDelete(SLE::pointer sleEntry, bool bUnfunded = false);
void entryModify(SLE::pointer sleEntry);
SLE::pointer entryCreate(LedgerEntryType type, const uint256& index) { return mNodes.entryCreate(type, index); }
SLE::pointer entryCache(LedgerEntryType type, const uint256& index) { return mNodes.entryCache(type, index); }
void entryDelete(SLE::ref sleEntry) { mNodes.entryDelete(sleEntry); }
void entryModify(SLE::ref sleEntry) { mNodes.entryModify(sleEntry); }
TER offerDelete(const uint256& uOfferIndex);
TER offerDelete(const SLE::pointer& sleOffer, const uint256& uOfferIndex, const uint160& uOwnerID);