| 
    rippled
    
   | 
 
TrustedVotes records the most recent votes from trusted validators. More...

Classes | |
| struct | UpvotesAndTimeout | 
Public Member Functions | |
| TrustedVotes ()=default | |
| TrustedVotes (TrustedVotes const &rhs)=delete | |
| TrustedVotes & | operator= (TrustedVotes const &rhs)=delete | 
| void | trustChanged (hash_set< PublicKey > const &allTrusted, std::lock_guard< std::mutex > const &lock) | 
| void | recordVotes (Rules const &rules, std::vector< std::shared_ptr< STValidation > > const &valSet, NetClock::time_point const closeTime, beast::Journal j, std::lock_guard< std::mutex > const &lock) | 
| std::pair< int, hash_map< uint256, int > > | getVotes (Rules const &rules, std::lock_guard< std::mutex > const &lock) const | 
Private Attributes | |
| hash_map< PublicKey, UpvotesAndTimeout > | recordedVotes_ | 
TrustedVotes records the most recent votes from trusted validators.
We keep a record in an effort to avoid "flapping" while amendment voting is in process.
If a trusted validator loses synchronization near a flag ledger their amendment votes may be lost during that round. If the validator is a bit flaky, then this can cause an amendment to appear to repeatedly gain and lose support.
TrustedVotes addresses the problem by holding on to the last vote seen from every trusted validator. So if any given validator is off line near a flag ledger we can assume that they did not change their vote.
If we haven't seen any STValidations from a validator for several hours we lose confidence that the validator hasn't changed their position. So there's a timeout. We remove upVotes if they haven't been updated in several hours.
Definition at line 93 of file AmendmentTable.cpp.
      
  | 
  default | 
      
  | 
  delete | 
      
  | 
  delete | 
| void ripple::TrustedVotes::trustChanged | ( | hash_set< PublicKey > const & | allTrusted, | 
| std::lock_guard< std::mutex > const & | lock | ||
| ) | 
Definition at line 120 of file AmendmentTable.cpp.
| void ripple::TrustedVotes::recordVotes | ( | Rules const & | rules, | 
| std::vector< std::shared_ptr< STValidation > > const & | valSet, | ||
| NetClock::time_point const | closeTime, | ||
| beast::Journal | j, | ||
| std::lock_guard< std::mutex > const & | lock | ||
| ) | 
Definition at line 153 of file AmendmentTable.cpp.
| std::pair< int, hash_map< uint256, int > > ripple::TrustedVotes::getVotes | ( | Rules const & | rules, | 
| std::lock_guard< std::mutex > const & | lock | ||
| ) | const | 
Definition at line 267 of file AmendmentTable.cpp.
      
  | 
  private | 
Definition at line 108 of file AmendmentTable.cpp.