Files
rippled/LedgerHistory_8h_source.html
2025-11-10 09:36:27 -08:00

246 lines
41 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>rippled: LedgerHistory.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">rippled
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_a62226f9e3a6c7c5a3be455e2f87ae01.html">xrpld</a></li><li class="navelem"><a class="el" href="dir_c69db3203fa08a9ff994909ba6ee9783.html">app</a></li><li class="navelem"><a class="el" href="dir_7899ad0c658a3b97a951171682eee0fc.html">ledger</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">LedgerHistory.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#ifndef XRPL_APP_LEDGER_LEDGERHISTORY_H_INCLUDED</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#define XRPL_APP_LEDGER_LEDGERHISTORY_H_INCLUDED</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span> </div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="preprocessor">#include &lt;xrpld/app/ledger/Ledger.h&gt;</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;xrpld/app/main/Application.h&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &lt;xrpl/beast/insight/Collector.h&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include &lt;xrpl/protocol/RippleLedgerHash.h&gt;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &lt;<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/optional.html">optional</a>&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespaceripple.html">ripple</a> {</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">// VFALCO TODO Rename to OldLedgers ?</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> </div>
<div class="foldopen" id="foldopen00017" data-start="{" data-end="};">
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="classripple_1_1LedgerHistory.html"> 17</a></span><span class="keyword">class </span><a class="code hl_class" href="classripple_1_1LedgerHistory.html">LedgerHistory</a></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span>{</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <a class="code hl_class" href="classripple_1_1LedgerHistory.html">LedgerHistory</a>(</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">beast::insight::Collector::ptr</a> <span class="keyword">const</span>&amp; collector,</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <a class="code hl_class" href="classripple_1_1Application.html">Application</a>&amp; app);</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordtype">bool</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <a class="code hl_function" href="classripple_1_1LedgerHistory.html#adaa8295b513d8c306f074cc9ca7755d0">insert</a>(<a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt;Ledger const&gt;</a> <span class="keyword">const</span>&amp; ledger, <span class="keywordtype">bool</span> validated);</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordtype">float</span></div>
<div class="foldopen" id="foldopen00034" data-start="{" data-end="}">
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="classripple_1_1LedgerHistory.html#a507bb40b5649985141e3dcbf57bd481d"> 34</a></span> <a class="code hl_function" href="classripple_1_1LedgerHistory.html#a507bb40b5649985141e3dcbf57bd481d">getCacheHitRate</a>()</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> {</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keywordflow">return</span> <a class="code hl_variable" href="classripple_1_1LedgerHistory.html#a6ad42489964a9f9b01df435e391bcfd2">m_ledgers_by_hash</a>.<a class="code hl_function" href="classripple_1_1TaggedCache.html#a7cb6eb2607f6d663e29ab7ea8d3774b1">getHitRate</a>();</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> }</div>
</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt;Ledger const&gt;</a></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <a class="code hl_function" href="classripple_1_1LedgerHistory.html#ad227291e26551b873ff494a27734a9d8">getLedgerBySeq</a>(<a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/types/integer.html">LedgerIndex</a> ledgerIndex);</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt;Ledger const&gt;</a></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <a class="code hl_function" href="classripple_1_1LedgerHistory.html#af1b5ae23538f3db1815018c0f185f19f">getLedgerByHash</a>(<a class="code hl_class" href="classripple_1_1base__uint.html">LedgerHash</a> <span class="keyword">const</span>&amp; ledgerHash);</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> </div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <a class="code hl_class" href="classripple_1_1base__uint.html">LedgerHash</a></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <a class="code hl_function" href="classripple_1_1LedgerHistory.html#a8decf929ebaba3425836b33fc74d6be4">getLedgerHash</a>(<a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/types/integer.html">LedgerIndex</a> ledgerIndex);</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> </div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keywordtype">void</span></div>
<div class="foldopen" id="foldopen00057" data-start="{" data-end="}">
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="classripple_1_1LedgerHistory.html#a5c3fbc509e1f5446d85176bac513e74c"> 57</a></span> <a class="code hl_function" href="classripple_1_1LedgerHistory.html#a5c3fbc509e1f5446d85176bac513e74c">sweep</a>()</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> {</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <a class="code hl_variable" href="classripple_1_1LedgerHistory.html#a6ad42489964a9f9b01df435e391bcfd2">m_ledgers_by_hash</a>.<a class="code hl_function" href="classripple_1_1TaggedCache.html#acb7b2bcb7ad7f8d2015eea180190f596">sweep</a>();</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <a class="code hl_variable" href="classripple_1_1LedgerHistory.html#a7c71cafdd85eba74ab6e4436d9ec9037">m_consensus_validated</a>.<a class="code hl_function" href="classripple_1_1TaggedCache.html#acb7b2bcb7ad7f8d2015eea180190f596">sweep</a>();</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> }</div>
</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> </div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="keywordtype">void</span></div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <a class="code hl_function" href="classripple_1_1LedgerHistory.html#a5b22f0c89730a59843fa1840d9225d27">builtLedger</a>(</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt;Ledger const&gt;</a> <span class="keyword">const</span>&amp;,</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <a class="code hl_class" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>&amp; consensusHash,</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a>);</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordtype">void</span></div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <a class="code hl_function" href="classripple_1_1LedgerHistory.html#ae3a7cdee19a26b3859e86b02e2cc3742">validatedLedger</a>(</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt;Ledger const&gt;</a> <span class="keyword">const</span>&amp;,</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional&lt;uint256&gt;</a> <span class="keyword">const</span>&amp; consensusHash);</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> </div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keywordtype">bool</span></div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <a class="code hl_function" href="classripple_1_1LedgerHistory.html#ae03adeae0930b7092edb4139cc7d0330">fixIndex</a>(<a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/types/integer.html">LedgerIndex</a> ledgerIndex, <a class="code hl_class" href="classripple_1_1base__uint.html">LedgerHash</a> <span class="keyword">const</span>&amp; ledgerHash);</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> </div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keywordtype">void</span></div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <a class="code hl_function" href="classripple_1_1LedgerHistory.html#a9d3e04a8d477455a9da28022915bad81">clearLedgerCachePrior</a>(<a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/types/integer.html">LedgerIndex</a> seq);</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> </div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="keywordtype">void</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <a class="code hl_function" href="classripple_1_1LedgerHistory.html#a8a5ccffa6c8b9c83d07f608b37a20899">handleMismatch</a>(</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <a class="code hl_class" href="classripple_1_1base__uint.html">LedgerHash</a> <span class="keyword">const</span>&amp; built,</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <a class="code hl_class" href="classripple_1_1base__uint.html">LedgerHash</a> <span class="keyword">const</span>&amp; <a class="code hl_function" href="namespaceripple_1_1credentials.html#ab0cd6a3f76fa9f09c5f1c2d6fffc11e0">valid</a>,</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional&lt;uint256&gt;</a> <span class="keyword">const</span>&amp; builtConsensusHash,</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional&lt;uint256&gt;</a> <span class="keyword">const</span>&amp; validatedConsensusHash,</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a> <span class="keyword">const</span>&amp; consensus);</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> </div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"><a class="line" href="classripple_1_1LedgerHistory.html#a7514a7d4ed469f9a72004040fe243db4"> 106</a></span> <a class="code hl_class" href="classripple_1_1Application.html">Application</a>&amp; <a class="code hl_variable" href="classripple_1_1LedgerHistory.html#a7514a7d4ed469f9a72004040fe243db4">app_</a>;</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"><a class="line" href="classripple_1_1LedgerHistory.html#aa4ab3f74729e78f0a67177555e159671"> 107</a></span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">beast::insight::Collector::ptr</a> <a class="code hl_variable" href="classripple_1_1LedgerHistory.html#aa4ab3f74729e78f0a67177555e159671">collector_</a>;</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"><a class="line" href="classripple_1_1LedgerHistory.html#ada81f3494202a6c8473ba4f17c12d91f"> 108</a></span> <a class="code hl_class" href="classbeast_1_1insight_1_1Counter.html">beast::insight::Counter</a> <a class="code hl_variable" href="classripple_1_1LedgerHistory.html#ada81f3494202a6c8473ba4f17c12d91f">mismatch_counter_</a>;</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> </div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"><a class="line" href="classripple_1_1LedgerHistory.html#a1e34d9ee13455de3ea2f919c202a1e1e"> 110</a></span> <span class="keyword">using </span><a class="code hl_class" href="classripple_1_1TaggedCache.html">LedgersByHash</a> = <a class="code hl_class" href="classripple_1_1TaggedCache.html">TaggedCache&lt;LedgerHash, Ledger const&gt;</a>;</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> </div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"><a class="line" href="classripple_1_1LedgerHistory.html#a6ad42489964a9f9b01df435e391bcfd2"> 112</a></span> <a class="code hl_class" href="classripple_1_1TaggedCache.html">LedgersByHash</a> <a class="code hl_variable" href="classripple_1_1LedgerHistory.html#a6ad42489964a9f9b01df435e391bcfd2">m_ledgers_by_hash</a>;</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> </div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="comment">// Maps ledger indexes to the corresponding hashes</span></div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="comment">// For debug and logging purposes</span></div>
<div class="foldopen" id="foldopen00116" data-start="{" data-end="};">
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"><a class="line" href="structripple_1_1LedgerHistory_1_1cv__entry.html"> 116</a></span> <span class="keyword">struct </span><a class="code hl_struct" href="structripple_1_1LedgerHistory_1_1cv__entry.html">cv_entry</a></div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> {</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="comment">// Hash of locally built ledger</span></div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"><a class="line" href="structripple_1_1LedgerHistory_1_1cv__entry.html#a8b472a2cf7e84430d9ce01dce209cb56"> 119</a></span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional&lt;LedgerHash&gt;</a> <a class="code hl_variable" href="structripple_1_1LedgerHistory_1_1cv__entry.html#a8b472a2cf7e84430d9ce01dce209cb56">built</a>;</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="comment">// Hash of the validated ledger</span></div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"><a class="line" href="structripple_1_1LedgerHistory_1_1cv__entry.html#ac0bfc50bf3098eb63ee0395a95cce397"> 121</a></span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional&lt;LedgerHash&gt;</a> <a class="code hl_variable" href="structripple_1_1LedgerHistory_1_1cv__entry.html#ac0bfc50bf3098eb63ee0395a95cce397">validated</a>;</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="comment">// Hash of locally accepted consensus transaction set</span></div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"><a class="line" href="structripple_1_1LedgerHistory_1_1cv__entry.html#abd60e88598204536623c867e11136ac9"> 123</a></span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional&lt;uint256&gt;</a> <a class="code hl_variable" href="structripple_1_1LedgerHistory_1_1cv__entry.html#abd60e88598204536623c867e11136ac9">builtConsensusHash</a>;</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="comment">// Hash of validated consensus transaction set</span></div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"><a class="line" href="structripple_1_1LedgerHistory_1_1cv__entry.html#aa6a49831bf517108f9e6aa7cb89fc646"> 125</a></span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional&lt;uint256&gt;</a> <a class="code hl_variable" href="structripple_1_1LedgerHistory_1_1cv__entry.html#aa6a49831bf517108f9e6aa7cb89fc646">validatedConsensusHash</a>;</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="comment">// Consensus metadata of built ledger</span></div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"><a class="line" href="structripple_1_1LedgerHistory_1_1cv__entry.html#aaa092c4e79f060432060905fa219f330"> 127</a></span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional&lt;Json::Value&gt;</a> <a class="code hl_variable" href="structripple_1_1LedgerHistory_1_1cv__entry.html#aaa092c4e79f060432060905fa219f330">consensus</a>;</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> };</div>
</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"><a class="line" href="classripple_1_1LedgerHistory.html#a4893ecfd7e45a96ca0b7ddd241edeba8"> 129</a></span> <span class="keyword">using </span><a class="code hl_class" href="classripple_1_1TaggedCache.html">ConsensusValidated</a> = <a class="code hl_class" href="classripple_1_1TaggedCache.html">TaggedCache&lt;LedgerIndex, cv_entry&gt;</a>;</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"><a class="line" href="classripple_1_1LedgerHistory.html#a7c71cafdd85eba74ab6e4436d9ec9037"> 130</a></span> <a class="code hl_class" href="classripple_1_1TaggedCache.html">ConsensusValidated</a> <a class="code hl_variable" href="classripple_1_1LedgerHistory.html#a7c71cafdd85eba74ab6e4436d9ec9037">m_consensus_validated</a>;</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> </div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="comment">// Maps ledger indexes to the corresponding hash.</span></div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"><a class="line" href="classripple_1_1LedgerHistory.html#a4fc23d794f5afd08ae10d9406f2874f8"> 133</a></span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/container/map.html">std::map&lt;LedgerIndex, LedgerHash&gt;</a> <a class="code hl_variable" href="classripple_1_1LedgerHistory.html#a4fc23d794f5afd08ae10d9406f2874f8">mLedgersByIndex</a>; <span class="comment">// validated ledgers</span></div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> </div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"><a class="line" href="classripple_1_1LedgerHistory.html#a8413110326cba685ff8cdb908ff310e9"> 135</a></span> <a class="code hl_class" href="classbeast_1_1Journal.html">beast::Journal</a> <a class="code hl_variable" href="classripple_1_1LedgerHistory.html#a8413110326cba685ff8cdb908ff310e9">j_</a>;</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span>};</div>
</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> </div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span>} <span class="comment">// namespace ripple</span></div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> </div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassJson_1_1Value_html"><div class="ttname"><a href="classJson_1_1Value.html">Json::Value</a></div><div class="ttdoc">Represents a JSON value.</div><div class="ttdef"><b>Definition</b> <a href="json__value_8h_source.html#l00130">json_value.h:131</a></div></div>
<div class="ttc" id="aclassbeast_1_1Journal_html"><div class="ttname"><a href="classbeast_1_1Journal.html">beast::Journal</a></div><div class="ttdoc">A generic endpoint for log messages.</div><div class="ttdef"><b>Definition</b> <a href="Journal_8h_source.html#l00040">Journal.h:41</a></div></div>
<div class="ttc" id="aclassbeast_1_1insight_1_1Counter_html"><div class="ttname"><a href="classbeast_1_1insight_1_1Counter.html">beast::insight::Counter</a></div><div class="ttdoc">A metric for measuring an integral value.</div><div class="ttdef"><b>Definition</b> <a href="Counter_8h_source.html#l00019">Counter.h:20</a></div></div>
<div class="ttc" id="aclassripple_1_1Application_html"><div class="ttname"><a href="classripple_1_1Application.html">ripple::Application</a></div><div class="ttdef"><b>Definition</b> <a href="Application_8h_source.html#l00094">Application.h:95</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html"><div class="ttname"><a href="classripple_1_1LedgerHistory.html">ripple::LedgerHistory</a></div><div class="ttdoc">Retains historical ledgers.</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8h_source.html#l00017">LedgerHistory.h:18</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html_a4fc23d794f5afd08ae10d9406f2874f8"><div class="ttname"><a href="classripple_1_1LedgerHistory.html#a4fc23d794f5afd08ae10d9406f2874f8">ripple::LedgerHistory::mLedgersByIndex</a></div><div class="ttdeci">std::map&lt; LedgerIndex, LedgerHash &gt; mLedgersByIndex</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8h_source.html#l00133">LedgerHistory.h:133</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html_a507bb40b5649985141e3dcbf57bd481d"><div class="ttname"><a href="classripple_1_1LedgerHistory.html#a507bb40b5649985141e3dcbf57bd481d">ripple::LedgerHistory::getCacheHitRate</a></div><div class="ttdeci">float getCacheHitRate()</div><div class="ttdoc">Get the ledgers_by_hash cache hit rate.</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8h_source.html#l00034">LedgerHistory.h:34</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html_a5b22f0c89730a59843fa1840d9225d27"><div class="ttname"><a href="classripple_1_1LedgerHistory.html#a5b22f0c89730a59843fa1840d9225d27">ripple::LedgerHistory::builtLedger</a></div><div class="ttdeci">void builtLedger(std::shared_ptr&lt; Ledger const &gt; const &amp;, uint256 const &amp;consensusHash, Json::Value)</div><div class="ttdoc">Report that we have locally built a particular ledger.</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8cpp_source.html#l00432">LedgerHistory.cpp:432</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html_a5c3fbc509e1f5446d85176bac513e74c"><div class="ttname"><a href="classripple_1_1LedgerHistory.html#a5c3fbc509e1f5446d85176bac513e74c">ripple::LedgerHistory::sweep</a></div><div class="ttdeci">void sweep()</div><div class="ttdoc">Remove stale cache entries.</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8h_source.html#l00057">LedgerHistory.h:57</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html_a6ad42489964a9f9b01df435e391bcfd2"><div class="ttname"><a href="classripple_1_1LedgerHistory.html#a6ad42489964a9f9b01df435e391bcfd2">ripple::LedgerHistory::m_ledgers_by_hash</a></div><div class="ttdeci">LedgersByHash m_ledgers_by_hash</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8h_source.html#l00112">LedgerHistory.h:112</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html_a7514a7d4ed469f9a72004040fe243db4"><div class="ttname"><a href="classripple_1_1LedgerHistory.html#a7514a7d4ed469f9a72004040fe243db4">ripple::LedgerHistory::app_</a></div><div class="ttdeci">Application &amp; app_</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8h_source.html#l00106">LedgerHistory.h:106</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html_a7c71cafdd85eba74ab6e4436d9ec9037"><div class="ttname"><a href="classripple_1_1LedgerHistory.html#a7c71cafdd85eba74ab6e4436d9ec9037">ripple::LedgerHistory::m_consensus_validated</a></div><div class="ttdeci">ConsensusValidated m_consensus_validated</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8h_source.html#l00130">LedgerHistory.h:130</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html_a8413110326cba685ff8cdb908ff310e9"><div class="ttname"><a href="classripple_1_1LedgerHistory.html#a8413110326cba685ff8cdb908ff310e9">ripple::LedgerHistory::j_</a></div><div class="ttdeci">beast::Journal j_</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8h_source.html#l00135">LedgerHistory.h:135</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html_a8a5ccffa6c8b9c83d07f608b37a20899"><div class="ttname"><a href="classripple_1_1LedgerHistory.html#a8a5ccffa6c8b9c83d07f608b37a20899">ripple::LedgerHistory::handleMismatch</a></div><div class="ttdeci">void handleMismatch(LedgerHash const &amp;built, LedgerHash const &amp;valid, std::optional&lt; uint256 &gt; const &amp;builtConsensusHash, std::optional&lt; uint256 &gt; const &amp;validatedConsensusHash, Json::Value const &amp;consensus)</div><div class="ttdoc">Log details in the case where we build one ledger but validate a different one.</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8cpp_source.html#l00320">LedgerHistory.cpp:320</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html_a8decf929ebaba3425836b33fc74d6be4"><div class="ttname"><a href="classripple_1_1LedgerHistory.html#a8decf929ebaba3425836b33fc74d6be4">ripple::LedgerHistory::getLedgerHash</a></div><div class="ttdeci">LedgerHash getLedgerHash(LedgerIndex ledgerIndex)</div><div class="ttdoc">Get a ledger's hash given its sequence number.</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8cpp_source.html#l00058">LedgerHistory.cpp:58</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html_a9d3e04a8d477455a9da28022915bad81"><div class="ttname"><a href="classripple_1_1LedgerHistory.html#a9d3e04a8d477455a9da28022915bad81">ripple::LedgerHistory::clearLedgerCachePrior</a></div><div class="ttdeci">void clearLedgerCachePrior(LedgerIndex seq)</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8cpp_source.html#l00531">LedgerHistory.cpp:531</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html_aa4ab3f74729e78f0a67177555e159671"><div class="ttname"><a href="classripple_1_1LedgerHistory.html#aa4ab3f74729e78f0a67177555e159671">ripple::LedgerHistory::collector_</a></div><div class="ttdeci">beast::insight::Collector::ptr collector_</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8h_source.html#l00107">LedgerHistory.h:107</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html_ad227291e26551b873ff494a27734a9d8"><div class="ttname"><a href="classripple_1_1LedgerHistory.html#ad227291e26551b873ff494a27734a9d8">ripple::LedgerHistory::getLedgerBySeq</a></div><div class="ttdeci">std::shared_ptr&lt; Ledger const &gt; getLedgerBySeq(LedgerIndex ledgerIndex)</div><div class="ttdoc">Get a ledger given its sequence number.</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8cpp_source.html#l00067">LedgerHistory.cpp:67</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html_ada81f3494202a6c8473ba4f17c12d91f"><div class="ttname"><a href="classripple_1_1LedgerHistory.html#ada81f3494202a6c8473ba4f17c12d91f">ripple::LedgerHistory::mismatch_counter_</a></div><div class="ttdeci">beast::insight::Counter mismatch_counter_</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8h_source.html#l00108">LedgerHistory.h:108</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html_adaa8295b513d8c306f074cc9ca7755d0"><div class="ttname"><a href="classripple_1_1LedgerHistory.html#adaa8295b513d8c306f074cc9ca7755d0">ripple::LedgerHistory::insert</a></div><div class="ttdeci">bool insert(std::shared_ptr&lt; Ledger const &gt; const &amp;ledger, bool validated)</div><div class="ttdoc">Track a ledger.</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8cpp_source.html#l00036">LedgerHistory.cpp:36</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html_ae03adeae0930b7092edb4139cc7d0330"><div class="ttname"><a href="classripple_1_1LedgerHistory.html#ae03adeae0930b7092edb4139cc7d0330">ripple::LedgerHistory::fixIndex</a></div><div class="ttdeci">bool fixIndex(LedgerIndex ledgerIndex, LedgerHash const &amp;ledgerHash)</div><div class="ttdoc">Repair a hash to index mapping.</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8cpp_source.html#l00517">LedgerHistory.cpp:517</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html_ae3a7cdee19a26b3859e86b02e2cc3742"><div class="ttname"><a href="classripple_1_1LedgerHistory.html#ae3a7cdee19a26b3859e86b02e2cc3742">ripple::LedgerHistory::validatedLedger</a></div><div class="ttdeci">void validatedLedger(std::shared_ptr&lt; Ledger const &gt; const &amp;, std::optional&lt; uint256 &gt; const &amp;consensusHash)</div><div class="ttdoc">Report that we have validated a particular ledger.</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8cpp_source.html#l00474">LedgerHistory.cpp:474</a></div></div>
<div class="ttc" id="aclassripple_1_1LedgerHistory_html_af1b5ae23538f3db1815018c0f185f19f"><div class="ttname"><a href="classripple_1_1LedgerHistory.html#af1b5ae23538f3db1815018c0f185f19f">ripple::LedgerHistory::getLedgerByHash</a></div><div class="ttdeci">std::shared_ptr&lt; Ledger const &gt; getLedgerByHash(LedgerHash const &amp;ledgerHash)</div><div class="ttdoc">Retrieve a ledger given its hash.</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8cpp_source.html#l00104">LedgerHistory.cpp:104</a></div></div>
<div class="ttc" id="aclassripple_1_1TaggedCache_html"><div class="ttname"><a href="classripple_1_1TaggedCache.html">ripple::TaggedCache</a></div><div class="ttdoc">Map/cache combination.</div><div class="ttdef"><b>Definition</b> <a href="TaggedCache_8h_source.html#l00042">TaggedCache.h:43</a></div></div>
<div class="ttc" id="aclassripple_1_1TaggedCache_html_a7cb6eb2607f6d663e29ab7ea8d3774b1"><div class="ttname"><a href="classripple_1_1TaggedCache.html#a7cb6eb2607f6d663e29ab7ea8d3774b1">ripple::TaggedCache::getHitRate</a></div><div class="ttdeci">float getHitRate()</div></div>
<div class="ttc" id="aclassripple_1_1TaggedCache_html_acb7b2bcb7ad7f8d2015eea180190f596"><div class="ttname"><a href="classripple_1_1TaggedCache.html#acb7b2bcb7ad7f8d2015eea180190f596">ripple::TaggedCache::sweep</a></div><div class="ttdeci">void sweep()</div></div>
<div class="ttc" id="aclassripple_1_1base__uint_html"><div class="ttname"><a href="classripple_1_1base__uint.html">ripple::base_uint&lt; 256 &gt;</a></div></div>
<div class="ttc" id="ainteger_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a></div></div>
<div class="ttc" id="amap_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/map.html">std::map</a></div></div>
<div class="ttc" id="anamespaceripple_1_1credentials_html_ab0cd6a3f76fa9f09c5f1c2d6fffc11e0"><div class="ttname"><a href="namespaceripple_1_1credentials.html#ab0cd6a3f76fa9f09c5f1c2d6fffc11e0">ripple::credentials::valid</a></div><div class="ttdeci">TER valid(STTx const &amp;tx, ReadView const &amp;view, AccountID const &amp;src, beast::Journal j)</div><div class="ttdef"><b>Definition</b> <a href="CredentialHelpers_8cpp_source.html#l00137">CredentialHelpers.cpp:137</a></div></div>
<div class="ttc" id="anamespaceripple_html"><div class="ttname"><a href="namespaceripple.html">ripple</a></div><div class="ttdoc">Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.</div><div class="ttdef"><b>Definition</b> <a href="algorithm_8h_source.html#l00006">algorithm.h:6</a></div></div>
<div class="ttc" id="aoptional_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/header/optional.html">optional</a></div></div>
<div class="ttc" id="ashared_ptr_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt; Collector &gt;</a></div></div>
<div class="ttc" id="astructripple_1_1LedgerHistory_1_1cv__entry_html"><div class="ttname"><a href="structripple_1_1LedgerHistory_1_1cv__entry.html">ripple::LedgerHistory::cv_entry</a></div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8h_source.html#l00116">LedgerHistory.h:117</a></div></div>
<div class="ttc" id="astructripple_1_1LedgerHistory_1_1cv__entry_html_a8b472a2cf7e84430d9ce01dce209cb56"><div class="ttname"><a href="structripple_1_1LedgerHistory_1_1cv__entry.html#a8b472a2cf7e84430d9ce01dce209cb56">ripple::LedgerHistory::cv_entry::built</a></div><div class="ttdeci">std::optional&lt; LedgerHash &gt; built</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8h_source.html#l00119">LedgerHistory.h:119</a></div></div>
<div class="ttc" id="astructripple_1_1LedgerHistory_1_1cv__entry_html_aa6a49831bf517108f9e6aa7cb89fc646"><div class="ttname"><a href="structripple_1_1LedgerHistory_1_1cv__entry.html#aa6a49831bf517108f9e6aa7cb89fc646">ripple::LedgerHistory::cv_entry::validatedConsensusHash</a></div><div class="ttdeci">std::optional&lt; uint256 &gt; validatedConsensusHash</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8h_source.html#l00125">LedgerHistory.h:125</a></div></div>
<div class="ttc" id="astructripple_1_1LedgerHistory_1_1cv__entry_html_aaa092c4e79f060432060905fa219f330"><div class="ttname"><a href="structripple_1_1LedgerHistory_1_1cv__entry.html#aaa092c4e79f060432060905fa219f330">ripple::LedgerHistory::cv_entry::consensus</a></div><div class="ttdeci">std::optional&lt; Json::Value &gt; consensus</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8h_source.html#l00127">LedgerHistory.h:127</a></div></div>
<div class="ttc" id="astructripple_1_1LedgerHistory_1_1cv__entry_html_abd60e88598204536623c867e11136ac9"><div class="ttname"><a href="structripple_1_1LedgerHistory_1_1cv__entry.html#abd60e88598204536623c867e11136ac9">ripple::LedgerHistory::cv_entry::builtConsensusHash</a></div><div class="ttdeci">std::optional&lt; uint256 &gt; builtConsensusHash</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8h_source.html#l00123">LedgerHistory.h:123</a></div></div>
<div class="ttc" id="astructripple_1_1LedgerHistory_1_1cv__entry_html_ac0bfc50bf3098eb63ee0395a95cce397"><div class="ttname"><a href="structripple_1_1LedgerHistory_1_1cv__entry.html#ac0bfc50bf3098eb63ee0395a95cce397">ripple::LedgerHistory::cv_entry::validated</a></div><div class="ttdeci">std::optional&lt; LedgerHash &gt; validated</div><div class="ttdef"><b>Definition</b> <a href="LedgerHistory_8h_source.html#l00121">LedgerHistory.h:121</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>