Refine View interfaces:

This shores up the View interface support for contextual
transaction processing by putting params in the View, and
provides support for replacing the open ledger with the
open MetaView.

Transaction metadata is now part of the View interface.
Stacked MetaViews correctly apply their transaction
metadata to the parent.

* Add lastCloseTime to View
* Add insertTx to View, implement in MetaView
* Add View::txExists for transaction checking
* Add Fees to View, cache fees in Ledger and MetaView
* Use ViewFlags in View
* Use tapENABLE_TESTING flag for features
* Use cached Fees in View
* Rename to ViewFlags
* Move FreezeHandling to View.h, remove ViewAPIBasics.h
* Remove BasicView::parent hack
* Remove calls to getLedger in Transactors
This commit is contained in:
Vinnie Falco
2015-06-25 12:29:48 -07:00
committed by Nik Bougalis
parent 2fc8d70655
commit 57689c4e66
53 changed files with 1046 additions and 753 deletions

View File

@@ -350,7 +350,9 @@ public:
ScopedLockType sl (m_mutex);
// Start with a mutable snapshot of the open ledger
TransactionEngine engine (mCurrentLedger.getMutable ());
auto const ledger =
mCurrentLedger.getMutable();
TransactionEngine engine (ledger);
int recovers = 0;
@@ -358,10 +360,10 @@ public:
{
try
{
TransactionEngineParams tepFlags = tapOPEN_LEDGER;
ViewFlags tepFlags = tapOPEN_LEDGER;
if (getApp().getHashRouter ().addSuppressionFlags (it.first.getTXID (), SF_SIGGOOD))
tepFlags = static_cast<TransactionEngineParams> (tepFlags | tapNO_CHECK_SIGN);
tepFlags = static_cast<ViewFlags> (tepFlags | tapNO_CHECK_SIGN);
auto ret = engine.applyTransaction (*it.second, tepFlags);
@@ -382,8 +384,8 @@ public:
CondLog (recovers != 0, lsINFO, LedgerMaster) << "Recovered " << recovers << " held transactions";
// VFALCO TODO recreate the CanonicalTxSet object instead of resetting it
mHeldTransactions.reset (engine.getLedger()->getHash ());
mCurrentLedger.set (engine.getLedger ());
mHeldTransactions.reset (ledger->getHash ());
mCurrentLedger.set (ledger);
}
LedgerIndex getBuildingLedger ()