Missing functions, and an easy way to specify no special parameters.

This commit is contained in:
JoelKatz
2012-04-20 17:42:54 -07:00
parent 8372b0d572
commit f6f9ba4d08
2 changed files with 10 additions and 0 deletions

View File

@@ -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<SHAMapItem>(txID, txn.peekData());
return mTransactionMap->addGiveItem(item, true);
}
bool Ledger::delTransaction(const uint256& transID)
{
assert(!mAccepted);

View File

@@ -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<Ledger>
{ // The basic Ledger structure, can be opened, closed, or synching
friend class TransactionEngine;
public:
typedef boost::shared_ptr<Ledger> 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);