mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Reject expired transactions immediately
This commit is contained in:
@@ -104,11 +104,16 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
std::uint32_t getCurrentLedgerIndex ()
|
||||
LedgerIndex getCurrentLedgerIndex ()
|
||||
{
|
||||
return mCurrentLedger.get ()->getLedgerSeq ();
|
||||
}
|
||||
|
||||
LedgerIndex getValidLedgerIndex ()
|
||||
{
|
||||
return mValidLedgerSeq;
|
||||
}
|
||||
|
||||
int getPublishedLedgerAge ()
|
||||
{
|
||||
std::uint32_t pubClose = mPubLedgerClose.load();
|
||||
|
||||
@@ -47,7 +47,8 @@ public:
|
||||
|
||||
virtual ~LedgerMaster () = 0;
|
||||
|
||||
virtual std::uint32_t getCurrentLedgerIndex () = 0;
|
||||
virtual LedgerIndex getCurrentLedgerIndex () = 0;
|
||||
virtual LedgerIndex getValidLedgerIndex () = 0;
|
||||
|
||||
virtual LockType& peekMutex () = 0;
|
||||
|
||||
|
||||
@@ -2606,12 +2606,19 @@ private:
|
||||
try
|
||||
{
|
||||
#endif
|
||||
Transaction::pointer tx;
|
||||
|
||||
if (isSetBit (flags, SF_SIGGOOD))
|
||||
tx = boost::make_shared<Transaction> (stx, false);
|
||||
else
|
||||
tx = boost::make_shared<Transaction> (stx, true);
|
||||
if (stx->isFieldPresent(sfLastLedgerSequence) &&
|
||||
(stx->getFieldU32 (sfLastLedgerSequence) <
|
||||
getApp().getLedgerMaster().getValidLedgerIndex()))
|
||||
{ // Transaction has expired
|
||||
getApp().getHashRouter().setFlag(stx->getTransactionID(), SF_BAD);
|
||||
Peer::charge (peer, Resource::feeUnwantedData);
|
||||
return;
|
||||
}
|
||||
|
||||
bool needCheck = ! isSetBit (flags, SF_SIGGOOD);
|
||||
Transaction::pointer tx =
|
||||
boost::make_shared<Transaction> (stx, needCheck);
|
||||
|
||||
if (tx->getStatus () == INVALID)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user