|
xrpld
|
A transaction discovered to be in dispute during consensus. More...
#include <DisputedTx.h>

Public Member Functions | |
| DisputedTx (Tx tx, bool ourVote, std::size_t numPeers, beast::Journal j) | |
| Constructor. | |
| TxID_t const & | id () const |
| The unique id/hash of the disputed transaction. | |
| bool | getOurVote () const |
| Our vote on whether the transaction should be included. | |
| bool | stalled (ConsensusParms const &p, bool proposing, int peersUnchanged, beast::Journal j, std::unique_ptr< std::stringstream > const &clog) const |
| Are we and our peers "stalled" where we probably won't change our vote? | |
| Tx const & | tx () const |
| The disputed transaction. | |
| void | setOurVote (bool o) |
| Change our vote. | |
| bool | setVote (NodeId const &peer, bool votesYes) |
| Change a peer's vote. | |
| void | unVote (NodeId const &peer) |
| Remove a peer's vote. | |
| bool | updateVote (int percentTime, bool proposing, ConsensusParms const &p) |
| Update our vote given progression of consensus. | |
| json::Value | getJson () const |
| JSON representation of dispute, used for debugging. | |
Private Types | |
| using | TxID_t = Tx::ID |
| using | Map_t = boost::container::flat_map<NodeId, bool> |
Private Attributes | |
| int | yays_ {0} |
| int | nays_ {0} |
| bool | ourVote_ |
| Tx | tx_ |
| Map_t | votes_ |
| std::size_t | currentVoteCounter_ = 0 |
| The number of rounds we've gone without changing our vote. | |
| ConsensusParms::AvalancheState | avalancheState_ = ConsensusParms::AvalancheState::Init |
| Which minimum acceptance percentage phase we are currently in. | |
| std::size_t | avalancheCounter_ = 0 |
| How long we have been in the current acceptance phase. | |
| beast::Journal const | j_ |
A transaction discovered to be in dispute during consensus.
During consensus, a DisputedTx is created when a transaction is discovered to be disputed. The object persists only as long as the dispute.
Undisputed transactions have no corresponding DisputedTx object.
Refer to Consensus for details on the template type requirements.
| Tx | The type for a transaction |
| NodeId | The type for a node identifier |
Definition at line 35 of file DisputedTx.h.
|
private |
Definition at line 37 of file DisputedTx.h.
|
private |
Definition at line 38 of file DisputedTx.h.
| xrpl::DisputedTx< Tx, NodeId >::DisputedTx | ( | Tx | tx, |
| bool | ourVote, | ||
| std::size_t | numPeers, | ||
| beast::Journal | j ) |
Constructor.
| tx | The transaction under dispute |
| ourVote | Our vote on whether tx should be included |
| numPeers | Anticipated number of peer votes |
| j | Journal for debugging |
Definition at line 49 of file DisputedTx.h.
|
nodiscard |
The unique id/hash of the disputed transaction.
Definition at line 59 of file DisputedTx.h.
|
nodiscard |
Our vote on whether the transaction should be included.
Definition at line 68 of file DisputedTx.h.
|
nodiscard |
Are we and our peers "stalled" where we probably won't change our vote?
Definition at line 78 of file DisputedTx.h.
|
nodiscard |
The disputed transaction.
Definition at line 145 of file DisputedTx.h.
| void xrpl::DisputedTx< Tx, NodeId >::setOurVote | ( | bool | o | ) |
Change our vote.
Definition at line 154 of file DisputedTx.h.
|
nodiscard |
Change a peer's vote.
| peer | Identifier of peer. |
| votesYes | Whether peer votes to include the disputed transaction. |
Definition at line 224 of file DisputedTx.h.
| void xrpl::DisputedTx< Tx, NodeId >::unVote | ( | NodeId const & | peer | ) |
Remove a peer's vote.
| peer | Identifier of peer. |
Definition at line 267 of file DisputedTx.h.
| bool xrpl::DisputedTx< Tx, NodeId >::updateVote | ( | int | percentTime, |
| bool | proposing, | ||
| ConsensusParms const & | p ) |
Update our vote given progression of consensus.
Updates our vote on this disputed transaction based on our peers' votes and how far along consensus has proceeded.
| percentTime | Percentage progress through consensus, e.g. 50% through or 90%. |
| proposing | Whether we are proposing to our peers in this round. |
| p | Consensus parameters controlling thresholds for voting |
Definition at line 288 of file DisputedTx.h.
|
nodiscard |
JSON representation of dispute, used for debugging.
Definition at line 346 of file DisputedTx.h.
|
private |
Definition at line 201 of file DisputedTx.h.
|
private |
Definition at line 202 of file DisputedTx.h.
|
private |
Definition at line 203 of file DisputedTx.h.
|
private |
Definition at line 204 of file DisputedTx.h.
|
private |
Definition at line 205 of file DisputedTx.h.
|
private |
The number of rounds we've gone without changing our vote.
Definition at line 209 of file DisputedTx.h.
|
private |
Which minimum acceptance percentage phase we are currently in.
Definition at line 213 of file DisputedTx.h.
|
private |
How long we have been in the current acceptance phase.
Definition at line 217 of file DisputedTx.h.
|
private |
Definition at line 218 of file DisputedTx.h.