20 #ifndef RIPPLE_APP_MISC_TRANSACTION_H_INCLUDED
21 #define RIPPLE_APP_MISC_TRANSACTION_H_INCLUDED
23 #include <ripple/basics/RangeSet.h>
24 #include <ripple/beast/utility/Journal.h>
25 #include <ripple/protocol/ErrorCodes.h>
26 #include <ripple/protocol/Protocol.h>
27 #include <ripple/protocol/STTx.h>
28 #include <ripple/protocol/TER.h>
29 #include <ripple/protocol/TxMeta.h>
30 #include <boost/optional.hpp>
77 boost::optional<std::uint64_t>
const& ledgerSeq,
78 boost::optional<std::string>
const& status,
305 validatedLedger, fee, accountSeq, availableSeq);
328 return std::holds_alternative<std::pair<uint256, uint32_t>>(
338 return std::get<std::pair<uint256, uint32_t>>(
locator).first;
347 return std::get<std::pair<uint256, uint32_t>>(
locator).second;
356 return std::get<ClosedInterval<uint32_t>>(
locator);
static TransStatus sqlTransactionStatus(boost::optional< std::string > const &status)
std::uint32_t accountSeqAvail
static Transaction::pointer transactionFromSQL(boost::optional< std::uint64_t > const &ledgerSeq, boost::optional< std::string > const &status, Blob const &rawTxn, Application &app)
Tracks the number of instances of an object.
Json::Value getJson(JsonOptions options, bool binary=false) const
std::shared_ptr< STTx const > const & getSTransaction()
uint256 const & getNodestoreHash()
void setLedger(LedgerIndex ledger)
std::optional< CurrentLedgerState > currentLedgerState_
void setApplied()
setApplied Set this flag once was applied to open ledger
void setResult(TER terResult)
SubmitResult getSubmitResult() const
getSubmitResult Return submit result
uint256 const & getID() const
std::uint32_t accountSeqNext
void setStatus(TransStatus status)
std::shared_ptr< STTx const > mTransaction
void clear()
clear Clear all states
void clearSubmitResult()
clearSubmitResult Clear all flags in SubmitResult
bool getApplying()
Detect if transaction is being batched.
void setCurrentLedgerState(LedgerIndex validatedLedger, XRPAmount fee, std::uint32_t accountSeq, std::uint32_t availableSeq)
setCurrentLedgerState Set current ledger state of transaction
Transaction(std::shared_ptr< STTx const > const &, std::string &, Application &) noexcept
CurrentLedgerState()=delete
LedgerIndex getLedger() const
CurrentLedgerState(LedgerIndex li, XRPAmount fee, std::uint32_t accSeqNext, std::uint32_t accSeqAvail)
void setKept()
setKept Set this flag once was put to localtxns queue
static Locator locate(uint256 const &id, Application &app)
A generic endpoint for log messages.
bool any() const
any Get true of any state is true
SubmitResult submitResult_
different ways for transaction to be accepted
ClosedInterval< T > range(T low, T high)
Create a closed range interval.
TransStatus getStatus() const
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
static std::variant< std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > >, TxSearched > load(uint256 const &id, Application &app, error_code_i &ec)
std::variant< std::pair< uint256, uint32_t >, ClosedInterval< uint32_t > > locator
void setStatus(TransStatus status, std::uint32_t ledgerSeq)
boost::icl::closed_interval< T > ClosedInterval
A closed interval over the domain T.
void setApplying()
Set this flag once added to a batch.
std::optional< CurrentLedgerState > getCurrentLedgerState() const
getCurrentLedgerState Get current ledger state of transaction
uint32_t getLedgerSequence()
void setQueued()
setQueued Set this flag once was put into heldtxns queue
LedgerIndex validatedLedger
void setBroadcast()
setBroadcast Set this flag once was broadcasted via network
void clearApplying()
Indicate that transaction application has been attempted.
ClosedInterval< uint32_t > const & getLedgerRangeSearched()