Clio develop
The XRP Ledger API server.
|
This datastructure is used to keep track of the sequence of the most recent ledger validated by the network. More...
#include <NetworkValidatedLedgers.hpp>
Public Member Functions | |
void | push (uint32_t idx) final |
Notify the datastructure that idx has been validated by the network. | |
std::optional< uint32_t > | getMostRecent () final |
Get most recently validated sequence. | |
bool | waitUntilValidatedByNetwork (uint32_t sequence, std::optional< uint32_t > maxWaitMs={}) final |
Waits for the sequence to be validated by the network. | |
![]() |
Static Public Member Functions | |
static std::shared_ptr< NetworkValidatedLedgers > | makeValidatedLedgers () |
A factory function for NetworkValidatedLedgers. | |
This datastructure is used to keep track of the sequence of the most recent ledger validated by the network.
There are two methods that will wait until certain conditions are met. This datastructure is able to be "stopped". When the datastructure is stopped, any threads currently waiting are unblocked. Any later calls to methods of this datastructure will not wait. Once the datastructure is stopped, the datastructure remains stopped for the rest of its lifetime.
|
finalvirtual |
Get most recently validated sequence.
If no ledgers are known to have been validated, this function waits until the next ledger is validated
Implements etl::NetworkValidatedLedgersInterface.
|
static |
A factory function for NetworkValidatedLedgers.
|
finalvirtual |
Notify the datastructure that idx has been validated by the network.
idx | Sequence validated by network |
Implements etl::NetworkValidatedLedgersInterface.
|
finalvirtual |
Waits for the sequence to be validated by the network.
sequence | The sequence to wait for |
maxWaitMs | Maximum time to wait for the sequence to be validated. If empty, wait indefinitely |
Implements etl::NetworkValidatedLedgersInterface.