mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-28 14:35:48 +00:00
experimental large ledgers with no txq
This commit is contained in:
@@ -212,6 +212,7 @@ LedgerMaster::getCurrentLedgerIndex()
|
||||
LedgerIndex
|
||||
LedgerMaster::getValidLedgerIndex()
|
||||
{
|
||||
std::cout << "getValidLedgerIndex: " << mValidLedgerSeq << "\n";
|
||||
return mValidLedgerSeq;
|
||||
}
|
||||
|
||||
|
||||
@@ -745,7 +745,6 @@ TxQ::apply(
|
||||
// See if the transaction paid a high enough fee that it can go straight
|
||||
// into the ledger.
|
||||
|
||||
/* RHTEST
|
||||
view.getAndResetKeysTouched();
|
||||
if (auto directApplied = tryDirectApply(app, view, tx, flags, j))
|
||||
{
|
||||
@@ -753,7 +752,8 @@ TxQ::apply(
|
||||
transactionID, view.getAndResetKeysTouched());
|
||||
return *directApplied;
|
||||
}
|
||||
*/
|
||||
|
||||
return {telCAN_NOT_QUEUE, false};
|
||||
|
||||
// If we get past tryDirectApply() without returning then we expect
|
||||
// one of the following to occur:
|
||||
@@ -1930,13 +1930,15 @@ TxQ::tryDirectApply(
|
||||
const bool isFirstImport = !sleAccount &&
|
||||
view.rules().enabled(featureImport) && tx->getTxnType() == ttIMPORT;
|
||||
|
||||
bool const isReplayNetwork = (app.config().NETWORK_ID == 65534);
|
||||
|
||||
// Don't attempt to direct apply if the account is not in the ledger.
|
||||
if (!sleAccount && !isFirstImport)
|
||||
if (!sleAccount && !isFirstImport && !isReplayNetwork)
|
||||
return {};
|
||||
|
||||
std::optional<SeqProxy> txSeqProx;
|
||||
|
||||
if (!isFirstImport)
|
||||
if (!isFirstImport && !isReplayNetwork)
|
||||
{
|
||||
SeqProxy const acctSeqProx =
|
||||
SeqProxy::sequence((*sleAccount)[sfSequence]);
|
||||
@@ -1949,7 +1951,7 @@ TxQ::tryDirectApply(
|
||||
}
|
||||
|
||||
FeeLevel64 const requiredFeeLevel =
|
||||
isFirstImport ? FeeLevel64{0} : [this, &view, flags]() {
|
||||
(isFirstImport || isReplayNetwork) ? FeeLevel64{0} : [this, &view, flags]() {
|
||||
std::lock_guard lock(mutex_);
|
||||
return getRequiredFeeLevel(
|
||||
view, flags, feeMetrics_.getSnapshot(), lock);
|
||||
@@ -1959,7 +1961,7 @@ TxQ::tryDirectApply(
|
||||
// transaction straight into the ledger.
|
||||
FeeLevel64 const feeLevelPaid = getFeeLevelPaid(view, *tx);
|
||||
|
||||
if (feeLevelPaid >= requiredFeeLevel)
|
||||
if (feeLevelPaid >= requiredFeeLevel || isReplayNetwork)
|
||||
{
|
||||
// Attempt to apply the transaction directly.
|
||||
auto const transactionID = tx->getTransactionID();
|
||||
|
||||
@@ -49,7 +49,7 @@ LogicError(std::string const& s) noexcept
|
||||
{
|
||||
JLOG(debugLog().fatal()) << s;
|
||||
std::cerr << "Logic error: " << s << std::endl;
|
||||
detail::accessViolation();
|
||||
//detail::accessViolation();
|
||||
}
|
||||
|
||||
} // namespace ripple
|
||||
|
||||
@@ -263,6 +263,9 @@ OpenView::rawTxInsert(
|
||||
std::shared_ptr<Serializer const> const& txn,
|
||||
std::shared_ptr<Serializer const> const& metaData)
|
||||
{
|
||||
if (txExists(key))
|
||||
return;
|
||||
|
||||
auto const result = txs_.emplace(
|
||||
std::piecewise_construct,
|
||||
std::forward_as_tuple(key),
|
||||
|
||||
Reference in New Issue
Block a user