rippled
|
A transaction discovered to be in dispute during consensus. More...
Public Member Functions | |
DisputedTx (Tx_t const &tx, bool ourVote, std::size_t numPeers, beast::Journal j) | |
Constructor. More... | |
TxID_t const & | ID () const |
The unique id/hash of the disputed transaction. More... | |
bool | getOurVote () const |
Our vote on whether the transaction should be included. More... | |
Tx_t const & | tx () const |
The disputed transaction. More... | |
void | setOurVote (bool o) |
Change our vote. More... | |
void | setVote (NodeID_t const &peer, bool votesYes) |
Change a peer's vote. More... | |
void | unVote (NodeID_t const &peer) |
Remove a peer's vote. More... | |
bool | updateVote (int percentTime, bool proposing, ConsensusParms const &p) |
Update our vote given progression of consensus. More... | |
Json::Value | getJson () const |
JSON representation of dispute, used for debugging. More... | |
Private Types | |
using | TxID_t = typename Tx_t::ID |
using | Map_t = boost::container::flat_map< NodeID_t, bool > |
Private Attributes | |
int | yays_ |
int | nays_ |
bool | ourVote_ |
Tx_t | tx_ |
Map_t | votes_ |
const beast::Journal | 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_t | The type for a transaction |
NodeID_t | The type for a node identifier |
Definition at line 50 of file DisputedTx.h.
|
private |
Definition at line 52 of file DisputedTx.h.
|
private |
Definition at line 53 of file DisputedTx.h.
ripple::DisputedTx< Tx_t, NodeID_t >::DisputedTx | ( | Tx_t const & | 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 63 of file DisputedTx.h.
TxID_t const& ripple::DisputedTx< Tx_t, NodeID_t >::ID | ( | ) | const |
The unique id/hash of the disputed transaction.
Definition at line 75 of file DisputedTx.h.
bool ripple::DisputedTx< Tx_t, NodeID_t >::getOurVote | ( | ) | const |
Our vote on whether the transaction should be included.
Definition at line 82 of file DisputedTx.h.
Tx_t const& ripple::DisputedTx< Tx_t, NodeID_t >::tx | ( | ) | const |
The disputed transaction.
Definition at line 89 of file DisputedTx.h.
void ripple::DisputedTx< Tx_t, NodeID_t >::setOurVote | ( | bool | o | ) |
Change our vote.
Definition at line 96 of file DisputedTx.h.
void ripple::DisputedTx< Tx_t, NodeID_t >::setVote | ( | NodeID_t const & | peer, |
bool | votesYes | ||
) |
Change a peer's vote.
peer | Identifier of peer. |
votesYes | Whether peer votes to include the disputed transaction. |
Definition at line 146 of file DisputedTx.h.
void ripple::DisputedTx< Tx_t, NodeID_t >::unVote | ( | NodeID_t const & | peer | ) |
Remove a peer's vote.
peer | Identifier of peer. |
Definition at line 185 of file DisputedTx.h.
bool ripple::DisputedTx< Tx_t, NodeID_t >::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 202 of file DisputedTx.h.
Json::Value ripple::DisputedTx< Tx_t, NodeID_t >::getJson |
JSON representation of dispute, used for debugging.
Definition at line 257 of file DisputedTx.h.
|
private |
Definition at line 135 of file DisputedTx.h.
|
private |
Definition at line 136 of file DisputedTx.h.
|
private |
Definition at line 137 of file DisputedTx.h.
|
private |
Definition at line 138 of file DisputedTx.h.
|
private |
Definition at line 139 of file DisputedTx.h.
|
private |
Definition at line 140 of file DisputedTx.h.