| 
    rippled
    
   | 
 
#include <LedgerMaster.h>


Classes | |
| struct | Stats | 
Definition at line 51 of file LedgerMaster.h.
      
  | 
  explicit | 
Definition at line 99 of file LedgerMaster.cpp.
      
  | 
  virtualdefault | 
| LedgerIndex ripple::LedgerMaster::getCurrentLedgerIndex | ( | ) | 
Definition at line 123 of file LedgerMaster.cpp.
| LedgerIndex ripple::LedgerMaster::getValidLedgerIndex | ( | ) | 
Definition at line 129 of file LedgerMaster.cpp.
| bool ripple::LedgerMaster::isCompatible | ( | ReadView const & | view, | 
| beast::Journal::Stream | s, | ||
| char const * | reason | ||
| ) | 
Definition at line 135 of file LedgerMaster.cpp.
| std::recursive_mutex & ripple::LedgerMaster::peekMutex | ( | ) | 
Definition at line 1552 of file LedgerMaster.cpp.
| std::shared_ptr< ReadView const > ripple::LedgerMaster::getCurrentLedger | ( | ) | 
Definition at line 1559 of file LedgerMaster.cpp.
| std::shared_ptr< Ledger const > ripple::LedgerMaster::getClosedLedger | ( | ) | 
Definition at line 79 of file LedgerMaster.h.
| std::shared_ptr< Ledger const > ripple::LedgerMaster::getValidatedLedger | ( | ) | 
Definition at line 1565 of file LedgerMaster.cpp.
| Rules ripple::LedgerMaster::getValidatedRules | ( | ) | 
Definition at line 1571 of file LedgerMaster.cpp.
| std::shared_ptr< ReadView const > ripple::LedgerMaster::getPublishedLedger | ( | ) | 
Definition at line 1586 of file LedgerMaster.cpp.
| std::chrono::seconds ripple::LedgerMaster::getPublishedLedgerAge | ( | ) | 
Definition at line 166 of file LedgerMaster.cpp.
| std::chrono::seconds ripple::LedgerMaster::getValidatedLedgerAge | ( | ) | 
Definition at line 190 of file LedgerMaster.cpp.
| bool ripple::LedgerMaster::isCaughtUp | ( | std::string & | reason | ) | 
Definition at line 215 of file LedgerMaster.cpp.
| std::uint32_t ripple::LedgerMaster::getEarliestFetch | ( | ) | 
Definition at line 615 of file LedgerMaster.cpp.
| bool ripple::LedgerMaster::storeLedger | ( | std::shared_ptr< Ledger const > | ledger | ) | 
Definition at line 442 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::setFullLedger | ( | std::shared_ptr< Ledger const > const & | ledger, | 
| bool | isSynchronous, | ||
| bool | isCurrent | ||
| ) | 
Definition at line 804 of file LedgerMaster.cpp.
| bool ripple::LedgerMaster::canBeCurrent | ( | std::shared_ptr< Ledger const > const & | ledger | ) | 
Check the sequence number and parent close time of a ledger against our clock and last validated ledger to see if it can be the network's current ledger.
Definition at line 342 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::switchLCL | ( | std::shared_ptr< Ledger const > const & | lastClosed | ) | 
Definition at line 410 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::failedSave | ( | std::uint32_t | seq, | 
| uint256 const & | hash | ||
| ) | 
Definition at line 867 of file LedgerMaster.cpp.
| std::string ripple::LedgerMaster::getCompleteLedgers | ( | ) | 
Definition at line 1593 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::applyHeldTransactions | ( | ) | 
Apply held transactions to the open ledger This is normally called as we close the ledger.
The open ledger remains open to handle new transactions until a new open ledger is built.
Definition at line 455 of file LedgerMaster.cpp.
| std::shared_ptr< STTx const > ripple::LedgerMaster::popAcctTransaction | ( | std::shared_ptr< STTx const > const & | tx | ) | 
Get the next transaction held for a particular account if any.
This is normally called when a transaction for that account is successfully applied to the open ledger so the next transaction can be resubmitted without waiting for ledger close.
Definition at line 471 of file LedgerMaster.cpp.
| uint256 ripple::LedgerMaster::getHashBySeq | ( | std::uint32_t | index | ) | 
Get a ledger's hash by sequence number using the cache.
Definition at line 1630 of file LedgerMaster.cpp.
| std::optional< LedgerHash > ripple::LedgerMaster::walkHashBySeq | ( | std::uint32_t | index, | 
| InboundLedger::Reason | reason | ||
| ) | 
Walk to a ledger's hash using the skip list.
Definition at line 1641 of file LedgerMaster.cpp.
| std::optional< LedgerHash > ripple::LedgerMaster::walkHashBySeq | ( | std::uint32_t | index, | 
| std::shared_ptr< ReadView const > const & | referenceLedger, | ||
| InboundLedger::Reason | reason | ||
| ) | 
Walk the chain of ledger hashes to determine the hash of the ledger with the specified index.
The referenceLedger is used as the base of the chain and should be fully validated and must not precede the target index. This function may throw if nodes from the reference ledger or any prior ledger are not present in the node store.
Definition at line 1652 of file LedgerMaster.cpp.
| std::shared_ptr< Ledger const > ripple::LedgerMaster::getLedgerBySeq | ( | std::uint32_t | index | ) | 
Definition at line 1708 of file LedgerMaster.cpp.
| std::shared_ptr< Ledger const > ripple::LedgerMaster::getLedgerByHash | ( | uint256 const & | hash | ) | 
Definition at line 1744 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::setLedgerRangePresent | ( | std::uint32_t | minV, | 
| std::uint32_t | maxV | ||
| ) | 
Definition at line 1757 of file LedgerMaster.cpp.
| std::optional< NetClock::time_point > ripple::LedgerMaster::getCloseTimeBySeq | ( | LedgerIndex | ledgerIndex | ) | 
Definition at line 1600 of file LedgerMaster.cpp.
| std::optional< NetClock::time_point > ripple::LedgerMaster::getCloseTimeByHash | ( | LedgerHash const & | ledgerHash, | 
| LedgerIndex | ledgerIndex | ||
| ) | 
Definition at line 1608 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::addHeldTransaction | ( | std::shared_ptr< Transaction > const & | trans | ) | 
Definition at line 331 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::fixMismatch | ( | ReadView const & | ledger | ) | 
Definition at line 749 of file LedgerMaster.cpp.
| bool ripple::LedgerMaster::haveLedger | ( | std::uint32_t | seq | ) | 
Definition at line 485 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::clearLedger | ( | std::uint32_t | seq | ) | 
Definition at line 492 of file LedgerMaster.cpp.
| bool ripple::LedgerMaster::isValidated | ( | ReadView const & | ledger | ) | 
Definition at line 499 of file LedgerMaster.cpp.
| bool ripple::LedgerMaster::getValidatedRange | ( | std::uint32_t & | minVal, | 
| std::uint32_t & | maxVal | ||
| ) | 
Definition at line 574 of file LedgerMaster.cpp.
| bool ripple::LedgerMaster::getFullValidatedRange | ( | std::uint32_t & | minVal, | 
| std::uint32_t & | maxVal | ||
| ) | 
Definition at line 547 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::sweep | ( | ) | 
Definition at line 1764 of file LedgerMaster.cpp.
| float ripple::LedgerMaster::getCacheHitRate | ( | ) | 
Definition at line 1771 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::checkAccept | ( | std::shared_ptr< Ledger const > const & | ledger | ) | 
Definition at line 937 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::checkAccept | ( | uint256 const & | hash, | 
| std::uint32_t | seq | ||
| ) | 
Definition at line 876 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::consensusBuilt | ( | std::shared_ptr< Ledger const > const & | ledger, | 
| uint256 const & | consensusHash, | ||
| Json::Value | consensus | ||
| ) | 
Report that the consensus process built a particular ledger.
Definition at line 1085 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::setBuildingLedger | ( | LedgerIndex | index | ) | 
Definition at line 479 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::tryAdvance | ( | ) | 
Definition at line 1357 of file LedgerMaster.cpp.
| bool ripple::LedgerMaster::newPathRequest | ( | ) | 
Definition at line 1500 of file LedgerMaster.cpp.
| bool ripple::LedgerMaster::isNewPathRequest | ( | ) | 
Definition at line 1508 of file LedgerMaster.cpp.
| bool ripple::LedgerMaster::newOrderBookDB | ( | ) | 
Definition at line 1519 of file LedgerMaster.cpp.
| bool ripple::LedgerMaster::fixIndex | ( | LedgerIndex | ledgerIndex, | 
| LedgerHash const & | ledgerHash | ||
| ) | 
Definition at line 436 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::clearPriorLedgers | ( | LedgerIndex | seq | ) | 
Definition at line 1777 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::clearLedgerCachePrior | ( | LedgerIndex | seq | ) | 
Definition at line 1785 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::takeReplay | ( | std::unique_ptr< LedgerReplay > | replay | ) | 
Definition at line 1791 of file LedgerMaster.cpp.
| std::unique_ptr< LedgerReplay > ripple::LedgerMaster::releaseReplay | ( | ) | 
Definition at line 1797 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::gotFetchPack | ( | bool | progress, | 
| std::uint32_t | seq | ||
| ) | 
Definition at line 2028 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::addFetchPack | ( | uint256 const & | hash, | 
| std::shared_ptr< Blob > | data | ||
| ) | 
Definition at line 2009 of file LedgerMaster.cpp.
      
  | 
  overridevirtual | 
Retrieves partial ledger data of the coresponding hash from peers.
`
| nodeHash | The 256-bit hash of the data to fetch. | 
std::nullopt if the hash isn't cached, otherwise, the hash associated data. Implements ripple::AbstractFetchPackContainer.
Definition at line 2015 of file LedgerMaster.cpp.
| void ripple::LedgerMaster::makeFetchPack | ( | std::weak_ptr< Peer > const & | wPeer, | 
| std::shared_ptr< protocol::TMGetObjectByHash > const & | request, | ||
| uint256 | haveLedgerHash, | ||
| UptimeClock::time_point | uptime | ||
| ) | 
Definition at line 2098 of file LedgerMaster.cpp.
| std::size_t ripple::LedgerMaster::getFetchPackCacheSize | ( | ) | const | 
Definition at line 2230 of file LedgerMaster.cpp.
| bool ripple::LedgerMaster::haveValidated | ( | ) | 
Whether we have ever fully validated a ledger.
Definition at line 265 of file LedgerMaster.h.
| std::optional< LedgerIndex > ripple::LedgerMaster::minSqlSeq | ( | ) | 
Definition at line 2237 of file LedgerMaster.cpp.
| std::optional< uint256 > ripple::LedgerMaster::txnIdFromIndex | ( | uint32_t | ledgerSeq, | 
| uint32_t | txnIndex | ||
| ) | 
Definition at line 2243 of file LedgerMaster.cpp.
      
  | 
  private | 
Definition at line 240 of file LedgerMaster.cpp.
      
  | 
  private | 
Definition at line 323 of file LedgerMaster.cpp.
      
  | 
  private | 
Definition at line 629 of file LedgerMaster.cpp.
      
  | 
  private | 
Request a fetch pack to get to the specified ledger.
Definition at line 701 of file LedgerMaster.cpp.
      
  | 
  private | 
Definition at line 1186 of file LedgerMaster.cpp.
      
  | 
  private | 
Determines how many validations are needed to fully validate a ledger.
Definition at line 931 of file LedgerMaster.cpp.
      
  | 
  private | 
Definition at line 1803 of file LedgerMaster.cpp.
      
  | 
  private | 
Definition at line 1918 of file LedgerMaster.cpp.
      
  | 
  private | 
Definition at line 1208 of file LedgerMaster.cpp.
      
  | 
  private | 
Definition at line 1391 of file LedgerMaster.cpp.
      
  | 
  private | 
A thread needs to be dispatched to handle pathfinding work of some kind.
Definition at line 1530 of file LedgerMaster.cpp.
      
  | 
  private | 
Definition at line 415 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 317 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 318 of file LedgerMaster.h.
      
  | 
  mutableprivate | 
Definition at line 320 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 323 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 326 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 329 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 332 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 335 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 338 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 340 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 342 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 345 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 347 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 348 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 351 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 354 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 355 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 357 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 358 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 360 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 363 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 364 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 365 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 366 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 367 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 370 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 373 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 376 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 378 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 380 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 382 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 386 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 389 of file LedgerMaster.h.
      
  | 
  private | 
Definition at line 411 of file LedgerMaster.h.