Files
rippled/src/cpp/ripple/TransactionMaster.h
JoelKatz 312e476898 Fix a bug where a cached copy of a txn might not have a reference to the ledger
it was applied in, causing commands like 'tx' not to return metadata.
2013-02-27 18:23:24 -08:00

30 lines
689 B
C++

#ifndef __TRANSACTIONMASTER__
#define __TRANSACTIONMASTER__
#include "Transaction.h"
#include "TaggedCache.h"
// Tracks all transactions in memory
class TransactionMaster
{
protected:
TaggedCache<uint256, Transaction> mCache;
public:
TransactionMaster();
Transaction::pointer fetch(const uint256&, bool checkDisk);
SerializedTransaction::pointer fetch(SHAMapItem::ref item, SHAMapTreeNode:: TNType type,
bool checkDisk, uint32 uCommitLedger);
// return value: true = we had the transaction already
bool inLedger(const uint256& hash, uint32 ledger);
bool canonicalize(Transaction::pointer& txn, bool maybeNew);
void sweep(void) { mCache.sweep(); }
};
#endif
// vim:ts=4