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

@@ -1375,7 +1375,7 @@ void LedgerConsensusImp::takeInitialPosition (Ledger& initialLedger)
for (auto& it : mDisputes)
{
it.second->setOurVote (hasTransaction (initialLedger, it.first));
it.second->setOurVote (initialLedger.txExists(it.first));
}
// if any peers have taken a contrary position, process disputes
@@ -1722,22 +1722,22 @@ make_LedgerConsensus (ConsensusImp& consensus, int previousProposers,
static
int applyTransaction (
TransactionEngine& engine,
STTx::ref txn,
std::shared_ptr<STTx const> const& txn,
bool openLedger,
bool retryAssured)
{
// Returns false if the transaction has need not be retried.
TransactionEngineParams parms = openLedger ? tapOPEN_LEDGER : tapNONE;
ViewFlags parms = openLedger ? tapOPEN_LEDGER : tapNONE;
if (retryAssured)
{
parms = static_cast<TransactionEngineParams> (parms | tapRETRY);
parms = static_cast<ViewFlags> (parms | tapRETRY);
}
if ((getApp().getHashRouter ().getFlags (txn->getTransactionID ())
& SF_SIGGOOD) == SF_SIGGOOD)
{
parms = static_cast<TransactionEngineParams>
parms = static_cast<ViewFlags>
(parms | tapNO_CHECK_SIGN);
}
WriteLog (lsDEBUG, LedgerConsensus) << "TXN "
@@ -1790,7 +1790,7 @@ void applyTransactions (
{
for (auto const item : *set)
{
if (hasTransaction (*checkLedger, item->getTag ()))
if (checkLedger->txExists (item->key()))
continue;
// The transaction isn't in the check ledger, try to apply it