mirror of
https://github.com/XRPLF/rippled.git
synced 2026-10-03 18:28:07 +00:00
Apply transaction batches in periodic intervals (#4504)
Add new transaction submission API field, "sync", which determines behavior of the server while submitting transactions: 1) sync (default): Process transactions in a batch immediately, and return only once the transaction has been processed. 2) async: Put transaction into the batch for the next processing interval and return immediately. 3) wait: Put transaction into the batch for the next processing interval and return only after it is processed.
This commit is contained in:
@@ -802,7 +802,8 @@ transactionSubmit(
|
||||
Role role,
|
||||
std::chrono::seconds validatedLedgerAge,
|
||||
Application& app,
|
||||
ProcessTransactionFn const& processTransaction)
|
||||
ProcessTransactionFn const& processTransaction,
|
||||
RPC::SubmitSync sync)
|
||||
{
|
||||
using namespace detail;
|
||||
|
||||
@@ -828,8 +829,7 @@ transactionSubmit(
|
||||
// Finally, submit the transaction.
|
||||
try
|
||||
{
|
||||
// FIXME: For performance, should use asynch interface
|
||||
processTransaction(txn.second, isUnlimited(role), true, failType);
|
||||
processTransaction(txn.second, isUnlimited(role), sync, failType);
|
||||
}
|
||||
catch (std::exception&)
|
||||
{
|
||||
@@ -1038,7 +1038,8 @@ transactionSubmitMultiSigned(
|
||||
Role role,
|
||||
std::chrono::seconds validatedLedgerAge,
|
||||
Application& app,
|
||||
ProcessTransactionFn const& processTransaction)
|
||||
ProcessTransactionFn const& processTransaction,
|
||||
RPC::SubmitSync sync)
|
||||
{
|
||||
auto const& ledger = app.openLedger().current();
|
||||
auto j = app.journal("RPCHandler");
|
||||
@@ -1211,7 +1212,7 @@ transactionSubmitMultiSigned(
|
||||
try
|
||||
{
|
||||
// FIXME: For performance, should use asynch interface
|
||||
processTransaction(txn.second, isUnlimited(role), true, failType);
|
||||
processTransaction(txn.second, isUnlimited(role), sync, failType);
|
||||
}
|
||||
catch (std::exception&)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user