From f6f9ba4d08c41cb7c472a51f28a8b85f6acf6dc0 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Fri, 20 Apr 2012 17:42:54 -0700 Subject: [PATCH] Missing functions, and an easy way to specify no special parameters. --- src/Ledger.cpp | 6 ++++++ src/Ledger.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/Ledger.cpp b/src/Ledger.cpp index b22fdcd2b7..abac688f71 100644 --- a/src/Ledger.cpp +++ b/src/Ledger.cpp @@ -160,6 +160,12 @@ bool Ledger::addTransaction(Transaction::pointer trans) return mTransactionMap->addGiveItem(item, true); } +bool Ledger::addTransaction(const uint256& txID, const Serializer& txn) +{ // low-level - just add to table + SHAMapItem::pointer item = boost::make_shared(txID, txn.peekData()); + return mTransactionMap->addGiveItem(item, true); +} + bool Ledger::delTransaction(const uint256& transID) { assert(!mAccepted); diff --git a/src/Ledger.h b/src/Ledger.h index 7c670c1c41..f23d796304 100644 --- a/src/Ledger.h +++ b/src/Ledger.h @@ -20,6 +20,8 @@ enum LedgerStateParms { + lepNONE = 0, // no special flags + // input flags lepCREATE, // Create if not present @@ -33,6 +35,7 @@ enum LedgerStateParms class Ledger : public boost::enable_shared_from_this { // The basic Ledger structure, can be opened, closed, or synching + friend class TransactionEngine; public: typedef boost::shared_ptr pointer; @@ -73,6 +76,7 @@ protected: bool addAccountState(AccountState::pointer); bool updateAccountState(AccountState::pointer); bool addTransaction(Transaction::pointer); + bool addTransaction(const uint256& id, const Serializer& txn); bool delTransaction(const uint256& id); static Ledger::pointer getSQL(const std::string& sqlStatement);