mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Consensus ledger switch improvements
* Expire validations faster based on when we first saw them. * Never jump to a ledger prior to the latest fully-valid ledger * Drop validations with signing times too far in the future immediately
This commit is contained in:
@@ -23,11 +23,13 @@
|
||||
#include <ripple/overlay/impl/Tuning.h>
|
||||
#include <ripple/app/ledger/InboundLedgers.h>
|
||||
#include <ripple/app/ledger/LedgerMaster.h>
|
||||
#include <ripple/app/ledger/LedgerTiming.h>
|
||||
#include <ripple/app/ledger/InboundTransactions.h>
|
||||
#include <ripple/app/misc/HashRouter.h>
|
||||
#include <ripple/app/misc/NetworkOPs.h>
|
||||
#include <ripple/app/misc/Transaction.h>
|
||||
#include <ripple/app/misc/UniqueNodeList.h>
|
||||
#include <ripple/app/misc/Validations.h>
|
||||
#include <ripple/app/tx/apply.h>
|
||||
#include <ripple/protocol/digest.h>
|
||||
#include <ripple/basics/StringUtilities.h>
|
||||
@@ -1550,7 +1552,8 @@ void
|
||||
PeerImp::onMessage (std::shared_ptr <protocol::TMValidation> const& m)
|
||||
{
|
||||
error_code ec;
|
||||
auto const closeTime = app_.timeKeeper().closeTime().time_since_epoch().count();
|
||||
auto const closeTime =
|
||||
app_.timeKeeper().closeTime().time_since_epoch().count();
|
||||
|
||||
if (m->has_hops() && ! slot_->cluster())
|
||||
m->set_hops(m->hops() + 1);
|
||||
@@ -1569,11 +1572,12 @@ PeerImp::onMessage (std::shared_ptr <protocol::TMValidation> const& m)
|
||||
SerialIter sit (makeSlice(m->validation()));
|
||||
val = std::make_shared <
|
||||
STValidation> (std::ref (sit), false);
|
||||
val->setSeen (closeTime);
|
||||
}
|
||||
|
||||
if (closeTime > (120 + val->getFieldU32(sfSigningTime)))
|
||||
if (! app_.getValidations().current (val))
|
||||
{
|
||||
p_journal_.trace << "Validation: Too old";
|
||||
p_journal_.trace << "Validation: Not current";
|
||||
fee_ = Resource::feeUnwantedData;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user