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 <
cstdint
>
13
#include <
optional
>
14
15
namespace
xrpl
{
16
17
// Sync filters allow low-level SHAMapSync code to interact correctly with
18
// higher-level structures such as caches and transaction stores
19
20
// This class is needed on both add and check functions
21
// sync filter for transaction sets during consensus building
22
class
ConsensusTransSetSF
:
public
SHAMapSyncFilter
23
{
24
public
:
25
using
NodeCache
=
TaggedCache<SHAMapHash, Blob>
;
26
27
ConsensusTransSetSF
(
Application
& app,
NodeCache
& nodeCache);
28
29
// Note that the nodeData is overwritten by this call
30
void
31
gotNode
(
32
bool
fromFilter,
33
SHAMapHash
const
& nodeHash,
34
std::uint32_t
ledgerSeq,
35
Blob
&& nodeData,
36
SHAMapNodeType
type)
const override
;
37
38
[[nodiscard]]
std::optional<Blob>
39
getNode
(
SHAMapHash
const
& nodeHash)
const override
;
40
41
private
:
42
Application
&
app_
;
43
NodeCache
&
nodeCache_
;
44
beast::Journal
const
j_
;
45
};
46
47
}
// namespace xrpl
beast::Journal
A generic endpoint for log messages.
Definition
Journal.h:44
xrpl::Application
Definition
Application.h:94
xrpl::ConsensusTransSetSF::ConsensusTransSetSF
ConsensusTransSetSF(Application &app, NodeCache &nodeCache)
Definition
ConsensusTransSetSF.cpp:27
xrpl::ConsensusTransSetSF::NodeCache
TaggedCache< SHAMapHash, Blob > NodeCache
Definition
ConsensusTransSetSF.h:25
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:44
xrpl::ConsensusTransSetSF::app_
Application & app_
Definition
ConsensusTransSetSF.h:42
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:43
xrpl::SHAMapHash
Definition
SHAMapHash.h:16
xrpl::SHAMapSyncFilter::SHAMapSyncFilter
SHAMapSyncFilter()=default
xrpl::TaggedCache
Map/cache combination.
Definition
TaggedCache.h:67
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::Blob
std::vector< unsigned char > Blob
Storage for linear binary data.
Definition
Blob.h:11
optional
Generated by
1.17.0