19 #ifndef RIPPLE_CONSENSUS_ConsensusProposal_H_INCLUDED
20 #define RIPPLE_CONSENSUS_ConsensusProposal_H_INCLUDED
22 #include <ripple/basics/chrono.h>
23 #include <ripple/json/json_value.h>
24 #include <ripple/protocol/jss.h>
51 template <
class NodeID_t,
class LedgerID_t,
class Position_t>
156 return time_ <= cutoff;
168 Position_t
const& newPosition,
207 ret[jss::close_time] =
233 template <
class NodeID_t,
class LedgerID_t,
class Position_t>
NetClock::time_point time_
std::uint32_t proposeSeq() const
Get the sequence number of this proposal.
bool isStale(NetClock::time_point cutoff) const
Get whether this position is stale relative to the provided cutoff.
NetClock::time_point closeTime_
The ledger close time this position is taking.
Json::Value getJson() const
Get JSON representation for debugging.
NodeID_t nodeID_
The identifier of the node taking this position.
static const std::uint32_t seqLeave
void bowOut(NetClock::time_point now)
Leave consensus.
void changePosition(Position_t const &newPosition, NetClock::time_point newCloseTime, NetClock::time_point now)
Update the position during the consensus process.
bool operator==(Manifest const &lhs, Manifest const &rhs)
LedgerID_t const & prevLedger() const
Get the prior accepted ledger this position is based on.
ConsensusProposal(LedgerID_t const &prevLedger, std::uint32_t seq, Position_t const &position, NetClock::time_point closeTime, NetClock::time_point now, NodeID_t const &nodeID)
Constructor.
@ objectValue
object value (collection of name/value pairs).
std::uint32_t proposeSeq_
The sequence number of these positions taken by this node.
LedgerID_t previousLedger_
Unique identifier of prior ledger this proposal is based on.
NodeID_t const & nodeID() const
Identifying which peer took this position.
NetClock::time_point const & closeTime() const
The current position on the consensus close time.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool isBowOut() const
Get whether this node left the consensus process.
static const std::uint32_t seqJoin
NetClock::time_point const & seenTime() const
Get when this position was taken.
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
Position_t position_
Unique identifier of the position this proposal is taking.
Position_t const & position() const
Get the proposed position.
bool isInitial() const
Whether this is the first position taken during the current consensus round.
Represents a proposed position taken during a round of consensus.