xrpld
Loading...
Searching...
No Matches
xrpl::tests::SHAMapSyncTest::ChainFilter Class Reference

A sync filter that serves a range of a DeepChain's nodes, by hash. More...

Inheritance diagram for xrpl::tests::SHAMapSyncTest::ChainFilter:
Collaboration diagram for xrpl::tests::SHAMapSyncTest::ChainFilter:

Public Member Functions

 ChainFilter (DeepChain const &chain, unsigned int maxDepth=SHAMap::kLeafDepth, unsigned int minDepth=0)
void gotNode (bool, SHAMapHash const &, std::uint32_t, Blob &&, SHAMapNodeType) const override
std::optional< Blob > getNode (SHAMapHash const &hash) const override

Private Attributes

std::map< SHAMapHash, Blob > nodes_

Detailed Description

A sync filter that serves a range of a DeepChain's nodes, by hash.

Stands in for a fetch pack, which is checked against each node's own hash alone, so a walk resolves nodes locally through the filter rather than through addKnownNode(). Anything outside the range, including a decoy child, looks unavailable.

Definition at line 216 of file tests/libxrpl/shamap/SHAMapSync.cpp.

Constructor & Destructor Documentation

◆ ChainFilter()

xrpl::tests::SHAMapSyncTest::ChainFilter::ChainFilter ( DeepChain const & chain,
unsigned int maxDepth = SHAMap::kLeafDepth,
unsigned int minDepth = 0 )
explicit
Parameters
chainThe chain whose nodes to serve.
maxDepthThe deepest node to serve.
minDepthThe shallowest node to serve.

Definition at line 224 of file tests/libxrpl/shamap/SHAMapSync.cpp.

Member Function Documentation

◆ gotNode()

void xrpl::tests::SHAMapSyncTest::ChainFilter::gotNode ( bool ,
SHAMapHash const & ,
std::uint32_t ,
Blob && ,
SHAMapNodeType  ) const
overridevirtual

Implements xrpl::SHAMapSyncFilter.

Definition at line 234 of file tests/libxrpl/shamap/SHAMapSync.cpp.

◆ getNode()

std::optional< Blob > xrpl::tests::SHAMapSyncTest::ChainFilter::getNode ( SHAMapHash const & hash) const
nodiscardoverridevirtual

Implements xrpl::SHAMapSyncFilter.

Definition at line 244 of file tests/libxrpl/shamap/SHAMapSync.cpp.

Member Data Documentation

◆ nodes_

std::map<SHAMapHash, Blob> xrpl::tests::SHAMapSyncTest::ChainFilter::nodes_
private

Definition at line 252 of file tests/libxrpl/shamap/SHAMapSync.cpp.