mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-26 22:15:52 +00:00
Avoid relaying very old transactions
This commit is contained in:
@@ -1101,10 +1101,11 @@ void PeerImp::recvTransaction (protocol::TMTransaction& packet, ScopedLock& Mast
|
||||
Serializer s (packet.rawtransaction ());
|
||||
SerializerIterator sit (s);
|
||||
SerializedTransaction::pointer stx = boost::make_shared<SerializedTransaction> (boost::ref (sit));
|
||||
uint256 txID = stx->getTransactionID();
|
||||
|
||||
int flags;
|
||||
|
||||
if (! theApp->getHashRouter ().addSuppressionPeer (stx->getTransactionID (), mPeerId, flags))
|
||||
if (! theApp->getHashRouter ().addSuppressionPeer (txID, mPeerId, flags))
|
||||
{
|
||||
// we have seen this transaction recently
|
||||
if (isSetBit (flags, SF_BAD))
|
||||
@@ -1117,7 +1118,12 @@ void PeerImp::recvTransaction (protocol::TMTransaction& packet, ScopedLock& Mast
|
||||
return;
|
||||
}
|
||||
|
||||
WriteLog (lsDEBUG, Peer) << "Got new transaction from peer " << getDisplayName () << " : " << stx->getTransactionID ();
|
||||
if (theApp->getMasterTransaction().fetch(txID, true))
|
||||
{
|
||||
WriteLog (lsDEBUG, Peer) << "Peer " << getDisplayName() << " send old TX " << txID;
|
||||
}
|
||||
|
||||
WriteLog (lsDEBUG, Peer) << "Got new transaction from peer " << getDisplayName () << " : " << txID;
|
||||
|
||||
if (mCluster)
|
||||
flags |= SF_TRUSTED | SF_SIGGOOD;
|
||||
|
||||
Reference in New Issue
Block a user