mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Speed up out of order transaction processing (RIPD-239):
* After successfully applying a transaction to the open ledger, resubmit any held transactions from the same account. * All held transactions will continue to be retried after consensus round.
This commit is contained in:
committed by
Nik Bougalis
parent
4d2e7ed404
commit
8be67c1766
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <BeastConfig.h>
|
||||
#include <ripple/app/misc/CanonicalTXSet.h>
|
||||
#include <boost/range/adaptor/transformed.hpp>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -96,6 +97,33 @@ void CanonicalTXSet::insert (std::shared_ptr<STTx const> const& txn)
|
||||
txn));
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<STTx const>>
|
||||
CanonicalTXSet::prune(AccountID const& account,
|
||||
std::uint32_t const seq)
|
||||
{
|
||||
auto effectiveAccount = accountKey (account);
|
||||
|
||||
Key keyLow(effectiveAccount, seq, zero);
|
||||
Key keyHigh(effectiveAccount, seq+1, zero);
|
||||
|
||||
auto range = boost::make_iterator_range(
|
||||
mMap.lower_bound(keyLow),
|
||||
mMap.lower_bound(keyHigh));
|
||||
auto txRange = boost::adaptors::transform(
|
||||
range,
|
||||
[](auto const& p)
|
||||
{
|
||||
return p.second;
|
||||
});
|
||||
|
||||
std::vector<std::shared_ptr<STTx const>> result(
|
||||
txRange.begin(), txRange.end());
|
||||
|
||||
mMap.erase(range.begin(), range.end());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
CanonicalTXSet::iterator CanonicalTXSet::erase (iterator const& it)
|
||||
{
|
||||
iterator tmp = it;
|
||||
|
||||
Reference in New Issue
Block a user