xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
xrpld
app
ledger
ConsensusTransSetSF.h
1
#pragma once
2
3
#include <xrpld/app/main/Application.h>
4
5
#include <xrpl/basics/Blob.h>
6
#include <xrpl/basics/SHAMapHash.h>
7
#include <xrpl/basics/TaggedCache.h>
8
#include <xrpl/beast/utility/Journal.h>
9
#include <xrpl/shamap/SHAMapSyncFilter.h>
10
#include <xrpl/shamap/SHAMapTreeNode.h>
11
12
#include <
cstddef
>
13
#include <
cstdint
>
14
#include <
optional
>
15
16
namespace
xrpl
{
17
18
// Sync filters allow low-level SHAMapSync code to interact correctly with
19
// higher-level structures such as caches and transaction stores
20
21
// This class is needed on both add and check functions
22
// sync filter for transaction sets during consensus building
23
class
ConsensusTransSetSF
:
public
SHAMapSyncFilter
24
{
25
public
:
26
using
NodeCache
=
TaggedCache<SHAMapHash, Blob>
;
27
34
static
constexpr
std::size_t
kMinTxNodeBytesToParse
=
35
sizeof
(
std::uint32_t
) +
kMinShaMapItemBytes
+ 1;
36
37
ConsensusTransSetSF
(
Application
& app,
NodeCache
& nodeCache);
38
39
// Note that the nodeData is overwritten by this call
40
void
41
gotNode
(
42
bool
fromFilter,
43
SHAMapHash
const
& nodeHash,
44
std::uint32_t
ledgerSeq,
45
Blob
&& nodeData,
46
SHAMapNodeType
type)
const override
;
47
48
[[nodiscard]]
std::optional<Blob>
49
getNode
(
SHAMapHash
const
& nodeHash)
const override
;
50
51
private
:
52
Application
&
app_
;
53
NodeCache
&
nodeCache_
;
54
beast::Journal
const
j_
;
55
};
56
57
}
// namespace xrpl
beast::Journal
A generic endpoint for log messages.
Definition
Journal.h:44
xrpl::Application
Definition
Application.h:94
xrpl::ConsensusTransSetSF::kMinTxNodeBytesToParse
static constexpr std::size_t kMinTxNodeBytesToParse
The size a node's hash-prefixed wire data must reach before gotNode() tries to parse and resubmit it ...
Definition
ConsensusTransSetSF.h:34
xrpl::ConsensusTransSetSF::ConsensusTransSetSF
ConsensusTransSetSF(Application &app, NodeCache &nodeCache)
Definition
ConsensusTransSetSF.cpp:27
xrpl::ConsensusTransSetSF::NodeCache
TaggedCache< SHAMapHash, Blob > NodeCache
Definition
ConsensusTransSetSF.h:26
xrpl::ConsensusTransSetSF::getNode
std::optional< Blob > getNode(SHAMapHash const &nodeHash) const override
Definition
ConsensusTransSetSF.cpp:73
xrpl::ConsensusTransSetSF::j_
beast::Journal const j_
Definition
ConsensusTransSetSF.h:54
xrpl::ConsensusTransSetSF::app_
Application & app_
Definition
ConsensusTransSetSF.h:52
xrpl::ConsensusTransSetSF::gotNode
void gotNode(bool fromFilter, SHAMapHash const &nodeHash, std::uint32_t ledgerSeq, Blob &&nodeData, SHAMapNodeType type) const override
Definition
ConsensusTransSetSF.cpp:33
xrpl::ConsensusTransSetSF::nodeCache_
NodeCache & nodeCache_
Definition
ConsensusTransSetSF.h:53
xrpl::SHAMapHash
Definition
SHAMapHash.h:16
xrpl::SHAMapSyncFilter::SHAMapSyncFilter
SHAMapSyncFilter()=default
xrpl::TaggedCache
Map/cache combination.
Definition
TaggedCache.h:67
cstddef
cstdint
std::uint32_t
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::SHAMapNodeType
SHAMapNodeType
Definition
SHAMapTreeNode.h:30
xrpl::kMinShaMapItemBytes
constexpr std::size_t kMinShaMapItemBytes
Definition
SHAMapTreeNode.h:28
xrpl::Blob
std::vector< unsigned char > Blob
Storage for linear binary data.
Definition
Blob.h:11
optional
std::size_t
Generated by
1.17.0