Switch to the new LedgerEntrySet code. This provides more sophisticated checkpointing and rewinding.

This commit is contained in:
JoelKatz
2012-07-26 04:07:37 -07:00
parent b575e72093
commit 5fa4bad9b5
4 changed files with 41 additions and 95 deletions

View File

@@ -7,6 +7,7 @@
#include "Ledger.h"
#include "SerializedTransaction.h"
#include "SerializedLedger.h"
#include "LedgerEntrySet.h"
// A TransactionEngine applies serialized transactions to a ledger
// It can also, verify signatures, verify fees, and give rejection reasons
@@ -97,17 +98,6 @@ enum TransactionEngineParams
tepMETADATA = 5, // put metadata in tree, not transaction
};
enum TransactionAccountAction
{
taaNONE,
taaCACHED, // Unmodified.
taaMODIFY, // Modifed, must have previously been taaCACHED.
taaDELETE, // Delete, must have previously been taaDELETE or taaMODIFY.
taaCREATE, // Newly created.
};
typedef std::pair<TransactionAccountAction, SerializedLedgerEntry::pointer> AffectedAccount;
// Hold a path state under incremental application.
class PathState
{
@@ -129,10 +119,7 @@ public:
class TransactionEngine
{
private:
typedef boost::unordered_map<uint256, std::pair<SLE::pointer, TransactionAccountAction> > entryMap;
typedef entryMap::iterator entryMap_iterator;
typedef entryMap::const_iterator entryMap_const_iterator;
typedef entryMap::iterator::value_type entryMap_value_type;
LedgerEntrySet mNodes, mOrigNodes;
TransactionEngineResult dirAdd(
uint64& uNodeDir, // Node of entry.
@@ -194,7 +181,6 @@ protected:
uint160 mTxnAccountID;
SLE::pointer mTxnAccount;
entryMap mEntries;
boost::unordered_set<uint256> mUnfunded; // Indexes that were found unfunded.
SLE::pointer entryCreate(LedgerEntryType letType, const uint256& uIndex);