20#ifndef RIPPLE_APP_CONSENSUSS_VALIDATIONS_H_INCLUDED
21#define RIPPLE_APP_CONSENSUSS_VALIDATIONS_H_INCLUDED
23#include <xrpld/app/ledger/Ledger.h>
24#include <xrpld/consensus/Validations.h>
26#include <xrpl/protocol/Protocol.h>
27#include <xrpl/protocol/RippleLedgerHash.h>
28#include <xrpl/protocol/STValidation.h>
63 return val_->getLedgerHash();
70 return val_->getFieldU32(sfLedgerSequence);
77 return val_->getSignTime();
84 return val_->getSeenTime();
91 return val_->getSignerPublic();
98 return val_->getNodeID();
105 return val_->isTrusted();
117 val_->setUntrusted();
124 return val_->isFull();
131 return ~(*val_)[~sfLoadFee];
138 return (*
val_)[sfCookie];
A generic endpoint for log messages.
Wraps a ledger instance for use in generic Validations LedgerTrie.
ID id() const
The ID (hash) of the ledger.
ID operator[](Seq const &s) const
Lookup the ID of the ancestor ledger.
friend Seq mismatch(RCLValidatedLedger const &a, RCLValidatedLedger const &b)
Find the sequence number of the earliest mismatching ancestor.
std::vector< uint256 > ancestors_
Seq seq() const
The sequence (index) of the ledger.
Wrapper over STValidation for generic Validation code.
std::shared_ptr< STValidation > val_
std::optional< std::uint32_t > loadFee() const
Get the load fee of the validation if it exists.
bool trusted() const
Whether the validation is considered trusted.
std::uint32_t seq() const
Validated ledger's sequence number (0 if none)
NetClock::time_point signTime() const
Validation's signing time.
NetClock::time_point seenTime() const
Validated ledger's first seen time.
std::uint64_t cookie() const
Get the cookie specified in the validation (0 if not set)
RCLValidation(std::shared_ptr< STValidation > const &v)
Constructor.
uint256 ledgerID() const
Validated ledger's hash.
std::shared_ptr< STValidation > unwrap() const
Extract the underlying STValidation being wrapped.
NodeID nodeID() const
NodeID of validator that published the validation.
bool full() const
Whether the validation is full (not-partial)
PublicKey key() const
Public key of validator that published the validation.
Generic validations adaptor class for RCL.
beast::Journal journal() const
std::optional< RCLValidatedLedger > acquire(LedgerHash const &id)
Attempt to acquire the ledger with given id from the network.
NetClock::time_point now() const
Current time used to determine if validations are stale.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::uint32_t LedgerIndex
A ledger index.
base_uint< 160, detail::NodeIDTag > NodeID
NodeID is a 160-bit hash representing one node.
void handleNewValidation(Application &app, std::shared_ptr< STValidation > const &val, std::string const &source, BypassAccept const bypassAccept, std::optional< beast::Journal > j)
Handle a new validation.