xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
xrpld
app
ledger
detail
LedgerReplay.cpp
1
#include <xrpld/app/ledger/LedgerReplay.h>
2
3
#include <xrpl/ledger/Ledger.h>
4
#include <xrpl/protocol/SField.h>
5
6
#include <
cstdint
>
7
#include <
map
>
8
#include <
memory
>
9
#include <
utility
>
10
11
namespace
xrpl
{
12
13
LedgerReplay::LedgerReplay
(
14
std::shared_ptr<Ledger const>
parent
,
15
std::shared_ptr<Ledger const>
replay
)
16
:
parent_
{
std
::move(
parent
)},
replay_
{
std
::move(
replay
)}
17
{
18
for
(
auto
const
& item :
replay_
->txMap())
19
{
20
auto txPair = replay_->txRead(item.key());
// non-const so can be moved
21
auto const txIndex = (*txPair.second)[sfTransactionIndex];
22
orderedTxns_.emplace(txIndex, std::move(txPair.first));
23
}
24
}
25
26
LedgerReplay::LedgerReplay
(
27
std::shared_ptr<Ledger const>
parent
,
28
std::shared_ptr<Ledger const>
replay
,
29
std::map
<
std::uint32_t
,
std::shared_ptr<STTx const>
>&&
orderedTxns
)
30
:
parent_
{
std
::move(
parent
)},
replay_
{
std
::move(
replay
)},
orderedTxns_
{
std
::move(
orderedTxns
)}
31
{
32
}
33
34
}
// namespace xrpl
xrpl::LedgerReplay::LedgerReplay
LedgerReplay(std::shared_ptr< Ledger const > parent, std::shared_ptr< Ledger const > replay)
Definition
LedgerReplay.cpp:13
xrpl::LedgerReplay::orderedTxns_
std::map< std::uint32_t, std::shared_ptr< STTx const > > orderedTxns_
Definition
LedgerReplay.h:18
xrpl::LedgerReplay::replay_
std::shared_ptr< Ledger const > replay_
Definition
LedgerReplay.h:17
xrpl::LedgerReplay::replay
std::shared_ptr< Ledger const > const & replay() const
Definition
LedgerReplay.h:41
xrpl::LedgerReplay::parent
std::shared_ptr< Ledger const > const & parent() const
Definition
LedgerReplay.h:32
xrpl::LedgerReplay::orderedTxns
std::map< std::uint32_t, std::shared_ptr< STTx const > > const & orderedTxns() const
Definition
LedgerReplay.h:50
xrpl::LedgerReplay::parent_
std::shared_ptr< Ledger const > parent_
Definition
LedgerReplay.h:16
cstdint
std::uint32_t
map
memory
std
STL namespace.
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
std::shared_ptr
utility
Generated by
1.17.0