Remove TRUST_NETWORK directive (RIPD-331)

This commit is contained in:
Miguel Portilla
2014-07-31 17:54:52 -04:00
committed by Nik Bougalis
parent 7b936de32c
commit dbe49bcd87
4 changed files with 1 additions and 33 deletions

View File

@@ -19,8 +19,6 @@
namespace ripple {
// #define TRUST_NETWORK
// Track a peer's yes/no vote on a particular disputed transaction
void DisputedTx::setVote (NodeID const& peer, bool votesYes)
{

View File

@@ -1427,10 +1427,8 @@ private:
// Then try to apply the transaction to applyLedger
WriteLog (lsINFO, LedgerConsensus) <<
"Processing candidate transaction: " << item->getTag ();
#ifndef TRUST_NETWORK
try
{
#endif
SerializerIterator sit (item->peekSerializer ());
SerializedTransaction::pointer txn
= std::make_shared<SerializedTransaction>(sit);
@@ -1441,13 +1439,11 @@ private:
// later retry.
retriableTransactions.push_back (txn);
}
#ifndef TRUST_NETWORK
}
catch (...)
{
WriteLog (lsWARNING, LedgerConsensus) << " Throws";
}
#endif
}
}
}
@@ -1540,14 +1536,8 @@ private:
<< (retryAssured ? "/retry" : "/final");
WriteLog (lsTRACE, LedgerConsensus) << txn->getJson (0);
// VFALCO TODO figure out what this "trust network"
// is all about and why it needs exceptions.
#ifndef TRUST_NETWORK
try
{
#endif
bool didApply;
TER result = engine.applyTransaction (*txn, parms, didApply);
@@ -1570,16 +1560,12 @@ private:
WriteLog (lsDEBUG, LedgerConsensus)
<< "Transaction retry: " << transHuman (result);
return resultRetry;
#ifndef TRUST_NETWORK
}
catch (...)
{
WriteLog (lsWARNING, LedgerConsensus) << "Throws";
return resultFail;
}
#endif
}
/**

View File

@@ -783,9 +783,6 @@ bool InboundLedger::takeHeader (const std::string& data)
if (m_journal.warning) m_journal.warning <<
mLedger->getHash () << "!=" << mHash;
mLedger.reset ();
#ifdef TRUST_NETWORK
assert (false);
#endif
return false;
}

View File

@@ -1078,15 +1078,12 @@ private:
static void checkTransaction (Job&, int flags, SerializedTransaction::pointer stx, std::weak_ptr<Peer> peer)
{
#ifndef TRUST_NETWORK
try
{
#endif
if (stx->isFieldPresent(sfLastLedgerSequence) &&
(stx->getFieldU32 (sfLastLedgerSequence) <
getApp().getLedgerMaster().getValidLedgerIndex()))
{ // Transaction has expired
{ // Transaction has expired
getApp().getHashRouter().setFlag(stx->getTransactionID(), SF_BAD);
charge (peer, Resource::feeUnwantedData);
return;
@@ -1107,16 +1104,12 @@ private:
bool const trusted (flags & SF_TRUSTED);
getApp().getOPs ().processTransaction (tx, trusted, false, false);
#ifndef TRUST_NETWORK
}
catch (...)
{
getApp().getHashRouter ().setFlag (stx->getTransactionID (), SF_BAD);
charge (peer, Resource::feeInvalidRequest);
}
#endif
}
// Called from our JobQueue
@@ -1195,10 +1188,7 @@ private:
static void checkValidation (Job&, Overlay* pPeers, SerializedValidation::pointer val, bool isTrusted, bool isCluster,
std::shared_ptr<protocol::TMValidation> packet, std::weak_ptr<Peer> peer)
{
#ifndef TRUST_NETWORK
try
#endif
{
uint256 signingHash = val->getSigningHash();
if (!isCluster && !val->isValid (signingHash))
@@ -1238,14 +1228,11 @@ private:
peer_in_set(peers)));
}
}
#ifndef TRUST_NETWORK
catch (...)
{
WriteLog(lsTRACE, Peer) << "Exception processing validation";
charge (peer, Resource::feeInvalidRequest);
}
#endif
}
};