mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Remove TRUST_NETWORK directive (RIPD-331)
This commit is contained in:
committed by
Nik Bougalis
parent
7b936de32c
commit
dbe49bcd87
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user