Files
rippled/AmendmentTable_8h_source.html
2020-05-06 06:59:28 +00:00

282 lines
43 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">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>rippled: AmendmentTable.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 style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">rippled
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @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:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- 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">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_df9c78dcf3f59a33b12284f95992a64b.html">ripple</a></li><li class="navelem"><a class="el" href="dir_9f69212e4c6e2ca9ec5ab59cd7b6275c.html">app</a></li><li class="navelem"><a class="el" href="dir_29f79f6f29a0be0eebc6c46bea51c866.html">misc</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">AmendmentTable.h</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">//------------------------------------------------------------------------------</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> This file is part of rippled: https://github.com/ripple/rippled</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> Copyright (c) 2012, 2013 Ripple Labs Inc.</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"></span> </div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> Permission to use, copy, modify, and/or distribute this software for any</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> purpose with or without fee is hereby granted, provided that the above</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> copyright notice and this permission notice appear in all copies.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"></span> </div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> THE SOFTWARE IS PROVIDED &quot;AS IS&quot; AND THE AUTHOR DISCLAIMS ALL WARRANTIES</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment">*/</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment">//==============================================================================</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160; </div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#ifndef RIPPLE_APP_MISC_AMENDMENTTABLE_H_INCLUDED</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#define RIPPLE_APP_MISC_AMENDMENTTABLE_H_INCLUDED</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &lt;ripple/app/ledger/Ledger.h&gt;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &lt;ripple/core/ConfigSections.h&gt;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &lt;ripple/protocol/Protocol.h&gt;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &lt;ripple/protocol/STValidation.h&gt;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceripple.html">ripple</a> {</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; </div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="classripple_1_1AmendmentTable.html"> 34</a></span>&#160;<span class="keyword">class </span><a class="code" href="classripple_1_1AmendmentTable.html">AmendmentTable</a></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;{</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <span class="keyword">virtual</span> <a class="code" href="classripple_1_1AmendmentTable.html#aef6ef4d534e0ef300563731966ed7f1d">~AmendmentTable</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <span class="keyword">virtual</span> <a class="code" href="classripple_1_1base__uint.html">uint256</a></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#adc2e5f3d711b40208ee7b27af6dcb451">find</a>(<a class="codeRef" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> <span class="keyword">const</span>&amp; name) = 0;</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; </div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#a5a0a3c98955ce15af2458780544edb71">veto</a>(<a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>&amp; amendment) = 0;</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#ad57021ddc7e6f87d04dd57fba582eb31">unVeto</a>(<a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>&amp; amendment) = 0;</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; </div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#ac9e23d71814bcf7c601f37e0b9323b1a">enable</a>(<a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>&amp; amendment) = 0;</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#a2f163c02ecd10e7f108023f97840bc2c">disable</a>(<a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>&amp; amendment) = 0;</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; </div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#a190291d07831f18a0ce7847000c24f17">isEnabled</a>(<a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>&amp; amendment) = 0;</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#a97273230ec904afe57818bb55aeecb02">isSupported</a>(<a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>&amp; amendment) = 0;</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; </div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#af0cddda279245d76de0710efeb41fa25">hasUnsupportedEnabled</a>() = 0;</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="keyword">virtual</span> boost::optional&lt;NetClock::time_point&gt;</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#abb11e40ced20aa1704b9b07b878bc3a0">firstUnsupportedExpected</a>() = 0;</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="keyword">virtual</span> <a class="code" href="classJson_1_1Value.html">Json::Value</a></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#a281bb75a522f82954bb6d50f1fc02785">getJson</a>(<span class="keywordtype">int</span>) = 0;</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; </div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="keyword">virtual</span> <a class="code" href="classJson_1_1Value.html">Json::Value</a></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#a281bb75a522f82954bb6d50f1fc02785">getJson</a>(<a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>&amp;) = 0;</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; </div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keywordtype">void</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="classripple_1_1AmendmentTable.html#ac721ac20262609226483f1436b0df02f"> 77</a></span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#ac721ac20262609226483f1436b0df02f">doValidatedLedger</a>(</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt;ReadView const&gt;</a> <span class="keyword">const</span>&amp; lastValidatedLedger)</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; {</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="classripple_1_1AmendmentTable.html#a06e29d55d53a9d5f1e2b4b7e4cc2c5e9">needValidatedLedger</a>(lastValidatedLedger-&gt;seq()))</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#ac721ac20262609226483f1436b0df02f">doValidatedLedger</a>(</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; lastValidatedLedger-&gt;seq(),</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <a class="code" href="namespaceripple.html#a6f8b0cab74710c17299c1d37f3e05b48">getEnabledAmendments</a>(*lastValidatedLedger),</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <a class="code" href="namespaceripple.html#ab6b00b336996c0b0a3fe2e8a8d5fa76a">getMajorityAmendments</a>(*lastValidatedLedger));</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; }</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; </div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#a06e29d55d53a9d5f1e2b4b7e4cc2c5e9">needValidatedLedger</a>(<a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">LedgerIndex</a> seq) = 0;</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; </div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#ac721ac20262609226483f1436b0df02f">doValidatedLedger</a>(</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">LedgerIndex</a> ledgerSeq,</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/container/set.html">std::set&lt;uint256&gt;</a> <span class="keyword">const</span>&amp; enabled,</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/container/map.html">majorityAmendments_t</a> <span class="keyword">const</span>&amp; majority) = 0;</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; </div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="comment">// Called by the consensus code when we need to</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="comment">// inject pseudo-transactions</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="keyword">virtual</span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/container/map.html">std::map&lt;uint256, std::uint32_t&gt;</a></div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#a879dd1b8a9991c7c281fbaf377e425e1">doVoting</a>(</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/chrono/time_point.html">NetClock::time_point</a> closeTime,</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/container/set.html">std::set&lt;uint256&gt;</a> <span class="keyword">const</span>&amp; enabledAmendments,</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/container/map.html">majorityAmendments_t</a> <span class="keyword">const</span>&amp; majorityAmendments,</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt;<a class="codeRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt;STValidation&gt;</a>&gt; <span class="keyword">const</span>&amp; valSet) = 0;</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; </div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="comment">// Called by the consensus code when we need to</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="comment">// add feature entries to a validation</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="keyword">virtual</span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;uint256&gt;</a></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#ad4448eeba600656f25e54dfcd18138af">doValidation</a>(<a class="codeRef" href="http://en.cppreference.com/w/cpp/container/set.html">std::set&lt;uint256&gt;</a> <span class="keyword">const</span>&amp; enabled) = 0;</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; </div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="comment">// The set of amendments to enable in the genesis ledger</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="comment">// This will return all known, non-vetoed amendments.</span></div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="comment">// If we ever have two amendments that should not both be</span></div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="comment">// enabled at the same time, we should ensure one is vetoed.</span></div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keyword">virtual</span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;uint256&gt;</a></div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#afefe2dd72c35d616baa3acfc43832179">getDesired</a>() = 0;</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; </div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="comment">// The function below adapts the API callers expect to the</span></div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="comment">// internal amendment table API. This allows the amendment</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="comment">// table implementation to be independent of the ledger</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <span class="comment">// implementation. These APIs will merge when the view code</span></div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="comment">// supports a full ledger API</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; </div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <span class="keywordtype">void</span></div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="classripple_1_1AmendmentTable.html#ae4402ab8248766bc7556bdbb93225943"> 127</a></span>&#160; <a class="code" href="classripple_1_1AmendmentTable.html#ae4402ab8248766bc7556bdbb93225943">doVoting</a>(</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt;ReadView const&gt;</a> <span class="keyword">const</span>&amp; lastClosedLedger,</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt;<a class="codeRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt;STValidation&gt;</a>&gt; <span class="keyword">const</span>&amp; parentValidations,</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt;SHAMap&gt;</a> <span class="keyword">const</span>&amp; initialPosition)</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; {</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="comment">// Ask implementation what to do</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="keyword">auto</span> actions = <a class="code" href="classripple_1_1AmendmentTable.html#a879dd1b8a9991c7c281fbaf377e425e1">doVoting</a>(</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; lastClosedLedger-&gt;parentCloseTime(),</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <a class="code" href="namespaceripple.html#a6f8b0cab74710c17299c1d37f3e05b48">getEnabledAmendments</a>(*lastClosedLedger),</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <a class="code" href="namespaceripple.html#ab6b00b336996c0b0a3fe2e8a8d5fa76a">getMajorityAmendments</a>(*lastClosedLedger),</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; parentValidations);</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; </div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <span class="comment">// Inject appropriate pseudo-transactions</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span>&amp; it : actions)</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; {</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <a class="code" href="classripple_1_1STTx.html">STTx</a> amendTx(</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <a class="code" href="namespaceripple.html#a48e7bc26e67dbb8709698c89f67a9264a0c108e5d380e14099ad0299d5c0ee510">ttAMENDMENT</a>,</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; [&amp;it, seq = lastClosedLedger-&gt;seq() + 1](<span class="keyword">auto</span>&amp; obj) {</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; obj.setAccountID(sfAccount, AccountID());</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; obj.setFieldH256(sfAmendment, it.first);</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; obj.setFieldU32(sfLedgerSequence, seq);</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; </div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; if (it.second != 0)</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; obj.setFieldU32(sfFlags, it.second);</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; });</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; </div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <a class="code" href="classripple_1_1Serializer.html">Serializer</a> s;</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; amendTx.<a class="code" href="classripple_1_1STObject.html#a04978b5398a7b54a93dba72826b9e849">add</a>(s);</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; </div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; initialPosition-&gt;addGiveItem(</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; std::make_shared&lt;SHAMapItem&gt;(</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; amendTx.<a class="code" href="classripple_1_1STTx.html#ad314af66e2542db537b3b5de291d33c3">getTransactionID</a>(), s.<a class="code" href="classripple_1_1Serializer.html#a5f8c275ba7cfa80e56671b6935e29242">peekData</a>()),</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <span class="keyword">true</span>,</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="keyword">false</span>);</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; }</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; }</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160;};</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; </div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;<a class="codeRef" href="http://en.cppreference.com/w/cpp/memory/unique_ptr.html">std::unique_ptr&lt;AmendmentTable&gt;</a></div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160;<a class="code" href="namespaceripple.html#ac19cff417e1091f50fc523c5a1755d62">make_AmendmentTable</a>(</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/chrono/duration.html">std::chrono::seconds</a> majorityTime,</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="keywordtype">int</span> majorityFraction,</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; Section <span class="keyword">const</span>&amp; supported,</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; Section <span class="keyword">const</span>&amp; enabled,</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; Section <span class="keyword">const</span>&amp; vetoed,</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <a class="code" href="classbeast_1_1Journal.html">beast::Journal</a> journal);</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; </div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160;} <span class="comment">// namespace ripple</span></div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; </div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="anamespaceripple_html_ab6b00b336996c0b0a3fe2e8a8d5fa76a"><div class="ttname"><a href="namespaceripple.html#ab6b00b336996c0b0a3fe2e8a8d5fa76a">ripple::getMajorityAmendments</a></div><div class="ttdeci">majorityAmendments_t getMajorityAmendments(ReadView const &amp;view)</div><div class="ttdef"><b>Definition:</b> <a href="View_8cpp_source.html#l00550">View.cpp:550</a></div></div>
<div class="ttc" id="anamespaceripple_html_a6f8b0cab74710c17299c1d37f3e05b48"><div class="ttname"><a href="namespaceripple.html#a6f8b0cab74710c17299c1d37f3e05b48">ripple::getEnabledAmendments</a></div><div class="ttdeci">std::set&lt; uint256 &gt; getEnabledAmendments(ReadView const &amp;view)</div><div class="ttdef"><b>Definition:</b> <a href="View_8cpp_source.html#l00533">View.cpp:533</a></div></div>
<div class="ttc" id="abasic_string_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a></div><div class="ttdoc">STL class.</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</a></div><div class="ttdoc">STL class.</div></div>
<div class="ttc" id="aclassripple_1_1AmendmentTable_html_a5a0a3c98955ce15af2458780544edb71"><div class="ttname"><a href="classripple_1_1AmendmentTable.html#a5a0a3c98955ce15af2458780544edb71">ripple::AmendmentTable::veto</a></div><div class="ttdeci">virtual bool veto(uint256 const &amp;amendment)=0</div></div>
<div class="ttc" id="aclassripple_1_1AmendmentTable_html_a06e29d55d53a9d5f1e2b4b7e4cc2c5e9"><div class="ttname"><a href="classripple_1_1AmendmentTable.html#a06e29d55d53a9d5f1e2b4b7e4cc2c5e9">ripple::AmendmentTable::needValidatedLedger</a></div><div class="ttdeci">virtual bool needValidatedLedger(LedgerIndex seq)=0</div><div class="ttdoc">Called to determine whether the amendment logic needs to process a new validated ledger.</div></div>
<div class="ttc" id="aclassripple_1_1AmendmentTable_html_adc2e5f3d711b40208ee7b27af6dcb451"><div class="ttname"><a href="classripple_1_1AmendmentTable.html#adc2e5f3d711b40208ee7b27af6dcb451">ripple::AmendmentTable::find</a></div><div class="ttdeci">virtual uint256 find(std::string const &amp;name)=0</div></div>
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div><div class="ttdoc">STL class.</div></div>
<div class="ttc" id="anamespaceripple_html_ac19cff417e1091f50fc523c5a1755d62"><div class="ttname"><a href="namespaceripple.html#ac19cff417e1091f50fc523c5a1755d62">ripple::make_AmendmentTable</a></div><div class="ttdeci">std::unique_ptr&lt; AmendmentTable &gt; make_AmendmentTable(std::chrono::seconds majorityTime, int majorityFraction, Section const &amp;supported, Section const &amp;enabled, Section const &amp;vetoed, beast::Journal journal)</div><div class="ttdef"><b>Definition:</b> <a href="AmendmentTable_8cpp_source.html#l00654">AmendmentTable.cpp:654</a></div></div>
<div class="ttc" id="aclassripple_1_1AmendmentTable_html_ae4402ab8248766bc7556bdbb93225943"><div class="ttname"><a href="classripple_1_1AmendmentTable.html#ae4402ab8248766bc7556bdbb93225943">ripple::AmendmentTable::doVoting</a></div><div class="ttdeci">void doVoting(std::shared_ptr&lt; ReadView const &gt; const &amp;lastClosedLedger, std::vector&lt; std::shared_ptr&lt; STValidation &gt;&gt; const &amp;parentValidations, std::shared_ptr&lt; SHAMap &gt; const &amp;initialPosition)</div><div class="ttdef"><b>Definition:</b> <a href="AmendmentTable_8h_source.html#l00127">AmendmentTable.h:127</a></div></div>
<div class="ttc" id="aduration_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/chrono/duration.html">std::chrono::seconds</a></div></div>
<div class="ttc" id="aclassripple_1_1AmendmentTable_html_ac721ac20262609226483f1436b0df02f"><div class="ttname"><a href="classripple_1_1AmendmentTable.html#ac721ac20262609226483f1436b0df02f">ripple::AmendmentTable::doValidatedLedger</a></div><div class="ttdeci">void doValidatedLedger(std::shared_ptr&lt; ReadView const &gt; const &amp;lastValidatedLedger)</div><div class="ttdoc">Called when a new fully-validated ledger is accepted.</div><div class="ttdef"><b>Definition:</b> <a href="AmendmentTable_8h_source.html#l00077">AmendmentTable.h:77</a></div></div>
<div class="ttc" id="aclassripple_1_1AmendmentTable_html_afefe2dd72c35d616baa3acfc43832179"><div class="ttname"><a href="classripple_1_1AmendmentTable.html#afefe2dd72c35d616baa3acfc43832179">ripple::AmendmentTable::getDesired</a></div><div class="ttdeci">virtual std::vector&lt; uint256 &gt; getDesired()=0</div></div>
<div class="ttc" id="aclassripple_1_1AmendmentTable_html_af0cddda279245d76de0710efeb41fa25"><div class="ttname"><a href="classripple_1_1AmendmentTable.html#af0cddda279245d76de0710efeb41fa25">ripple::AmendmentTable::hasUnsupportedEnabled</a></div><div class="ttdeci">virtual bool hasUnsupportedEnabled()=0</div><div class="ttdoc">returns true if one or more amendments on the network have been enabled that this server does not sup...</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="aclassripple_1_1AmendmentTable_html_ad57021ddc7e6f87d04dd57fba582eb31"><div class="ttname"><a href="classripple_1_1AmendmentTable.html#ad57021ddc7e6f87d04dd57fba582eb31">ripple::AmendmentTable::unVeto</a></div><div class="ttdeci">virtual bool unVeto(uint256 const &amp;amendment)=0</div></div>
<div class="ttc" id="aclassripple_1_1AmendmentTable_html_aef6ef4d534e0ef300563731966ed7f1d"><div class="ttname"><a href="classripple_1_1AmendmentTable.html#aef6ef4d534e0ef300563731966ed7f1d">ripple::AmendmentTable::~AmendmentTable</a></div><div class="ttdeci">virtual ~AmendmentTable()=default</div></div>
<div class="ttc" id="atime_point_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/chrono/time_point.html">std::chrono::time_point</a></div></div>
<div class="ttc" id="aclassripple_1_1STTx_html"><div class="ttname"><a href="classripple_1_1STTx.html">ripple::STTx</a></div><div class="ttdef"><b>Definition:</b> <a href="STTx_8h_source.html#l00042">STTx.h:42</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#l00058">Journal.h:58</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="anamespaceripple_html_a48e7bc26e67dbb8709698c89f67a9264a0c108e5d380e14099ad0299d5c0ee510"><div class="ttname"><a href="namespaceripple.html#a48e7bc26e67dbb8709698c89f67a9264a0c108e5d380e14099ad0299d5c0ee510">ripple::ttAMENDMENT</a></div><div class="ttdeci">@ ttAMENDMENT</div><div class="ttdef"><b>Definition:</b> <a href="TxFormats_8h_source.html#l00059">TxFormats.h:59</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 class="ttdoc">STL class.</div></div>
<div class="ttc" id="aclassripple_1_1AmendmentTable_html_ac9e23d71814bcf7c601f37e0b9323b1a"><div class="ttname"><a href="classripple_1_1AmendmentTable.html#ac9e23d71814bcf7c601f37e0b9323b1a">ripple::AmendmentTable::enable</a></div><div class="ttdeci">virtual bool enable(uint256 const &amp;amendment)=0</div></div>
<div class="ttc" id="aclassripple_1_1AmendmentTable_html_a97273230ec904afe57818bb55aeecb02"><div class="ttname"><a href="classripple_1_1AmendmentTable.html#a97273230ec904afe57818bb55aeecb02">ripple::AmendmentTable::isSupported</a></div><div class="ttdeci">virtual bool isSupported(uint256 const &amp;amendment)=0</div></div>
<div class="ttc" id="aclassripple_1_1AmendmentTable_html_a879dd1b8a9991c7c281fbaf377e425e1"><div class="ttname"><a href="classripple_1_1AmendmentTable.html#a879dd1b8a9991c7c281fbaf377e425e1">ripple::AmendmentTable::doVoting</a></div><div class="ttdeci">virtual std::map&lt; uint256, std::uint32_t &gt; doVoting(NetClock::time_point closeTime, std::set&lt; uint256 &gt; const &amp;enabledAmendments, majorityAmendments_t const &amp;majorityAmendments, std::vector&lt; std::shared_ptr&lt; STValidation &gt;&gt; const &amp;valSet)=0</div></div>
<div class="ttc" id="aclassripple_1_1STTx_html_ad314af66e2542db537b3b5de291d33c3"><div class="ttname"><a href="classripple_1_1STTx.html#ad314af66e2542db537b3b5de291d33c3">ripple::STTx::getTransactionID</a></div><div class="ttdeci">uint256 getTransactionID() const</div><div class="ttdef"><b>Definition:</b> <a href="STTx_8h_source.html#l00131">STTx.h:131</a></div></div>
<div class="ttc" id="aclassripple_1_1Serializer_html"><div class="ttname"><a href="classripple_1_1Serializer.html">ripple::Serializer</a></div><div class="ttdef"><b>Definition:</b> <a href="Serializer_8h_source.html#l00039">Serializer.h:39</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="RCLCensorshipDetector_8h_source.html#l00029">RCLCensorshipDetector.h:29</a></div></div>
<div class="ttc" id="aclassripple_1_1STObject_html_a04978b5398a7b54a93dba72826b9e849"><div class="ttname"><a href="classripple_1_1STObject.html#a04978b5398a7b54a93dba72826b9e849">ripple::STObject::add</a></div><div class="ttdeci">virtual void add(Serializer &amp;s) const override</div><div class="ttdef"><b>Definition:</b> <a href="STObject_8h_source.html#l00351">STObject.h:351</a></div></div>
<div class="ttc" id="aclassripple_1_1Serializer_html_a5f8c275ba7cfa80e56671b6935e29242"><div class="ttname"><a href="classripple_1_1Serializer.html#a5f8c275ba7cfa80e56671b6935e29242">ripple::Serializer::peekData</a></div><div class="ttdeci">Blob const &amp; peekData() const</div><div class="ttdef"><b>Definition:</b> <a href="Serializer_8h_source.html#l00166">Serializer.h:166</a></div></div>
<div class="ttc" id="aclassripple_1_1AmendmentTable_html_abb11e40ced20aa1704b9b07b878bc3a0"><div class="ttname"><a href="classripple_1_1AmendmentTable.html#abb11e40ced20aa1704b9b07b878bc3a0">ripple::AmendmentTable::firstUnsupportedExpected</a></div><div class="ttdeci">virtual boost::optional&lt; NetClock::time_point &gt; firstUnsupportedExpected()=0</div></div>
<div class="ttc" id="aclassripple_1_1AmendmentTable_html"><div class="ttname"><a href="classripple_1_1AmendmentTable.html">ripple::AmendmentTable</a></div><div class="ttdoc">The amendment table stores the list of enabled and potential amendments.</div><div class="ttdef"><b>Definition:</b> <a href="AmendmentTable_8h_source.html#l00034">AmendmentTable.h:34</a></div></div>
<div class="ttc" id="aunique_ptr_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/memory/unique_ptr.html">std::unique_ptr</a></div><div class="ttdoc">STL class.</div></div>
<div class="ttc" id="aclassripple_1_1AmendmentTable_html_a2f163c02ecd10e7f108023f97840bc2c"><div class="ttname"><a href="classripple_1_1AmendmentTable.html#a2f163c02ecd10e7f108023f97840bc2c">ripple::AmendmentTable::disable</a></div><div class="ttdeci">virtual bool disable(uint256 const &amp;amendment)=0</div></div>
<div class="ttc" id="aset_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/set.html">std::set</a></div><div class="ttdoc">STL class.</div></div>
<div class="ttc" id="aclassripple_1_1AmendmentTable_html_ad4448eeba600656f25e54dfcd18138af"><div class="ttname"><a href="classripple_1_1AmendmentTable.html#ad4448eeba600656f25e54dfcd18138af">ripple::AmendmentTable::doValidation</a></div><div class="ttdeci">virtual std::vector&lt; uint256 &gt; doValidation(std::set&lt; uint256 &gt; const &amp;enabled)=0</div></div>
<div class="ttc" id="aclassripple_1_1AmendmentTable_html_a281bb75a522f82954bb6d50f1fc02785"><div class="ttname"><a href="classripple_1_1AmendmentTable.html#a281bb75a522f82954bb6d50f1fc02785">ripple::AmendmentTable::getJson</a></div><div class="ttdeci">virtual Json::Value getJson(int)=0</div></div>
<div class="ttc" id="aclassripple_1_1AmendmentTable_html_a190291d07831f18a0ce7847000c24f17"><div class="ttname"><a href="classripple_1_1AmendmentTable.html#a190291d07831f18a0ce7847000c24f17">ripple::AmendmentTable::isEnabled</a></div><div class="ttdeci">virtual bool isEnabled(uint256 const &amp;amendment)=0</div></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#l00145">json_value.h:145</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>