mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Remove dead code. Add tie in to TransactionEngine code.
This commit is contained in:
@@ -14,20 +14,6 @@ uint32 LedgerMaster::getCurrentLedgerIndex()
|
|||||||
return mCurrentLedger->getLedgerSeq();
|
return mCurrentLedger->getLedgerSeq();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64 LedgerMaster::getBalance(const NewcoinAddress& acctID)
|
|
||||||
{
|
|
||||||
return mCurrentLedger->getBalance(acctID);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64 LedgerMaster::getBalance(std::string& strAcctID)
|
|
||||||
{
|
|
||||||
NewcoinAddress acctID;
|
|
||||||
|
|
||||||
acctID.setAccountID(strAcctID);
|
|
||||||
|
|
||||||
return mCurrentLedger->getBalance(acctID);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LedgerMaster::addHeldTransaction(Transaction::pointer transaction)
|
bool LedgerMaster::addHeldTransaction(Transaction::pointer transaction)
|
||||||
{ // returns true if transaction was added
|
{ // returns true if transaction was added
|
||||||
boost::recursive_mutex::scoped_lock ml(mLock);
|
boost::recursive_mutex::scoped_lock ml(mLock);
|
||||||
@@ -43,8 +29,9 @@ void LedgerMaster::pushLedger(Ledger::pointer newLedger)
|
|||||||
mFinalizingLedger->setAccepted();
|
mFinalizingLedger->setAccepted();
|
||||||
mLedgerHistory.addAcceptedLedger(mFinalizingLedger);
|
mLedgerHistory.addAcceptedLedger(mFinalizingLedger);
|
||||||
}
|
}
|
||||||
mFinalizingLedger=mCurrentLedger;
|
mFinalizingLedger = mCurrentLedger;
|
||||||
mCurrentLedger=newLedger;
|
mCurrentLedger = newLedger;
|
||||||
|
mEngine.setLedger(newLedger);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "Peer.h"
|
#include "Peer.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "Transaction.h"
|
#include "Transaction.h"
|
||||||
|
#include "TransactionEngine.h"
|
||||||
|
|
||||||
// Tracks the current ledger and any ledgers in the process of closing
|
// Tracks the current ledger and any ledgers in the process of closing
|
||||||
// Tracks ledger history
|
// Tracks ledger history
|
||||||
@@ -16,6 +17,8 @@ class LedgerMaster
|
|||||||
boost::recursive_mutex mLock;
|
boost::recursive_mutex mLock;
|
||||||
bool mIsSynced;
|
bool mIsSynced;
|
||||||
|
|
||||||
|
TransactionEngine mEngine;
|
||||||
|
|
||||||
Ledger::pointer mCurrentLedger;
|
Ledger::pointer mCurrentLedger;
|
||||||
Ledger::pointer mFinalizingLedger;
|
Ledger::pointer mFinalizingLedger;
|
||||||
|
|
||||||
@@ -38,6 +41,9 @@ public:
|
|||||||
Ledger::pointer getCurrentLedger() { return mCurrentLedger; }
|
Ledger::pointer getCurrentLedger() { return mCurrentLedger; }
|
||||||
Ledger::pointer getClosingLedger() { return mFinalizingLedger; }
|
Ledger::pointer getClosingLedger() { return mFinalizingLedger; }
|
||||||
|
|
||||||
|
TransactionEngineResult doTransaction(const SerializedTransaction& txn, TransactionEngineParams params)
|
||||||
|
{ return mEngine.applyTransaction(txn, params); }
|
||||||
|
|
||||||
void pushLedger(Ledger::pointer newLedger);
|
void pushLedger(Ledger::pointer newLedger);
|
||||||
|
|
||||||
Ledger::pointer getLedgerBySeq(uint32 index)
|
Ledger::pointer getLedgerBySeq(uint32 index)
|
||||||
@@ -54,12 +60,9 @@ public:
|
|||||||
return mLedgerHistory.getLedgerByHash(hash);
|
return mLedgerHistory.getLedgerByHash(hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64 getBalance(std::string& strAcctID);
|
|
||||||
uint64 getBalance(const NewcoinAddress& acctID);
|
|
||||||
AccountState::pointer getAccountState(const NewcoinAddress& addr)
|
|
||||||
{ return mCurrentLedger->getAccountState(addr); }
|
|
||||||
|
|
||||||
bool addHeldTransaction(Transaction::pointer trans);
|
bool addHeldTransaction(Transaction::pointer trans);
|
||||||
|
uint64 getBalance(std::string& strAcctID, const uint160 currency = 0);
|
||||||
|
uint64 getBalance(const NewcoinAddress& acctID, const uint160 currency = 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user