Files
rippled/SystemParameters_8h_source.html
2025-11-04 00:36:48 -08:00

173 lines
21 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: SystemParameters.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_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_0103a8ad82dcc2c51f5cde661b4b5cb7.html">xrpl</a></li><li class="navelem"><a class="el" href="dir_8d04e3c0b58cad28d7755ed462d1b6c0.html">protocol</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">SystemParameters.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_PROTOCOL_SYSTEMPARAMETERS_H_INCLUDED</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#define XRPL_PROTOCOL_SYSTEMPARAMETERS_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;xrpl/basics/chrono.h&gt;</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;xrpl/protocol/XRPAmount.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;<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/cstdint.html">cstdint</a>&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include &lt;<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/string.html">string</a>&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="keyword">namespace </span><a class="code hl_namespace" href="namespaceripple.html">ripple</a> {</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="comment">// Various protocol and system specific constant globals.</span></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">/* The name of the system. */</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="keyword">static</span> <span class="keyword">inline</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> <span class="keyword">const</span>&amp;</div>
<div class="foldopen" id="foldopen00016" data-start="{" data-end="}">
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"><a class="line" href="namespaceripple.html#a19807ba674cc970d6e0c15fa1512d422"> 16</a></span><a class="code hl_function" href="namespaceripple.html#a19807ba674cc970d6e0c15fa1512d422">systemName</a>()</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span>{</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keyword">static</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> <span class="keyword">const</span> name = <span class="stringliteral">&quot;ripple&quot;</span>;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordflow">return</span> name;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span>}</div>
</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="namespaceripple.html#a55a2a537e79363b71783d5f6eaca5abf"> 25</a></span><span class="keyword">constexpr</span> <a class="code hl_class" href="classripple_1_1XRPAmount.html">XRPAmount</a> <a class="code hl_variable" href="namespaceripple.html#a55a2a537e79363b71783d5f6eaca5abf">INITIAL_XRP</a>{100&#39;000&#39;000&#39;000 * <a class="code hl_variable" href="namespaceripple.html#afa493631a6ea5b71b91ceb86576fc328">DROPS_PER_XRP</a>};</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="keyword">inline</span> <span class="keywordtype">bool</span></div>
<div class="foldopen" id="foldopen00029" data-start="{" data-end="}">
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="namespaceripple.html#a2ad36218df31bca30cc7212166c77432"> 29</a></span><a class="code hl_function" href="namespaceripple.html#a2ad36218df31bca30cc7212166c77432">isLegalAmount</a>(<a class="code hl_class" href="classripple_1_1XRPAmount.html">XRPAmount</a> <span class="keyword">const</span>&amp; amount)</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span>{</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keywordflow">return</span> amount &lt;= <a class="code hl_variable" href="namespaceripple.html#a55a2a537e79363b71783d5f6eaca5abf">INITIAL_XRP</a>;</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span>}</div>
</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> </div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="keyword">inline</span> <span class="keywordtype">bool</span></div>
<div class="foldopen" id="foldopen00037" data-start="{" data-end="}">
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="namespaceripple.html#a558b17d6addfbe66741d3f5282292d94"> 37</a></span><a class="code hl_function" href="namespaceripple.html#a558b17d6addfbe66741d3f5282292d94">isLegalAmountSigned</a>(<a class="code hl_class" href="classripple_1_1XRPAmount.html">XRPAmount</a> <span class="keyword">const</span>&amp; amount)</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span>{</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordflow">return</span> amount &gt;= -<a class="code hl_variable" href="namespaceripple.html#a55a2a537e79363b71783d5f6eaca5abf">INITIAL_XRP</a> &amp;&amp; amount &lt;= <a class="code hl_variable" href="namespaceripple.html#a55a2a537e79363b71783d5f6eaca5abf">INITIAL_XRP</a>;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span>}</div>
</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="comment">/* The currency code for the native currency. */</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="keyword">static</span> <span class="keyword">inline</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> <span class="keyword">const</span>&amp;</div>
<div class="foldopen" id="foldopen00044" data-start="{" data-end="}">
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="namespaceripple.html#a4ba7590b028e34be0d0a8f0777ec3253"> 44</a></span><a class="code hl_function" href="namespaceripple.html#a4ba7590b028e34be0d0a8f0777ec3253">systemCurrencyCode</a>()</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span>{</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keyword">static</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> <span class="keyword">const</span> code = <span class="stringliteral">&quot;XRP&quot;</span>;</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordflow">return</span> code;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span>}</div>
</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> </div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="namespaceripple.html#a2c550f167665d94744b297523ff07de2"> 51</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> <a class="code hl_variable" href="namespaceripple.html#a2c550f167665d94744b297523ff07de2">XRP_LEDGER_EARLIEST_SEQ</a>{32570u};</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="namespaceripple.html#a6fc7a232cc9b90d4b5846057977fcf63"> 55</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> <a class="code hl_variable" href="namespaceripple.html#a6fc7a232cc9b90d4b5846057977fcf63">XRP_LEDGER_EARLIEST_FEES</a>{562177u};</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="namespaceripple.html#adab0af0c68aad5308660cf4738759771"> 58</a></span><span class="keyword">constexpr</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/numeric/ratio/ratio.html">std::ratio&lt;80, 100&gt;</a> <a class="code hl_variable" href="namespaceripple.html#adab0af0c68aad5308660cf4738759771">amendmentMajorityCalcThreshold</a>;</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="namespaceripple.html#a2766622cddc837e339cb2c5bec92fac8"> 61</a></span><span class="keyword">constexpr</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/chrono/duration.html">std::chrono::seconds</a> <span class="keyword">const</span> <a class="code hl_variable" href="namespaceripple.html#a2766622cddc837e339cb2c5bec92fac8">defaultAmendmentMajorityTime</a> = <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/chrono/duration.html">weeks</a>{2};</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> </div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span>} <span class="comment">// namespace ripple</span></div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> </div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span><span class="keyword">inline</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a> <span class="keyword">constexpr</span> DEFAULT_PEER_PORT{2459};</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> </div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span><span class="preprocessor">#endif</span></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>
<div class="ttc" id="aclassripple_1_1XRPAmount_html"><div class="ttname"><a href="classripple_1_1XRPAmount.html">ripple::XRPAmount</a></div><div class="ttdef"><b>Definition</b> <a href="XRPAmount_8h_source.html#l00020">XRPAmount.h:24</a></div></div>
<div class="ttc" id="acstdint_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/header/cstdint.html">cstdint</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="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"><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="anamespaceripple_html_a19807ba674cc970d6e0c15fa1512d422"><div class="ttname"><a href="namespaceripple.html#a19807ba674cc970d6e0c15fa1512d422">ripple::systemName</a></div><div class="ttdeci">static std::string const &amp; systemName()</div><div class="ttdef"><b>Definition</b> <a href="SystemParameters_8h_source.html#l00016">SystemParameters.h:16</a></div></div>
<div class="ttc" id="anamespaceripple_html_a2766622cddc837e339cb2c5bec92fac8"><div class="ttname"><a href="namespaceripple.html#a2766622cddc837e339cb2c5bec92fac8">ripple::defaultAmendmentMajorityTime</a></div><div class="ttdeci">constexpr std::chrono::seconds const defaultAmendmentMajorityTime</div><div class="ttdoc">The minimum amount of time an amendment must hold a majority.</div><div class="ttdef"><b>Definition</b> <a href="SystemParameters_8h_source.html#l00061">SystemParameters.h:61</a></div></div>
<div class="ttc" id="anamespaceripple_html_a2ad36218df31bca30cc7212166c77432"><div class="ttname"><a href="namespaceripple.html#a2ad36218df31bca30cc7212166c77432">ripple::isLegalAmount</a></div><div class="ttdeci">bool isLegalAmount(XRPAmount const &amp;amount)</div><div class="ttdoc">Returns true if the amount does not exceed the initial XRP in existence.</div><div class="ttdef"><b>Definition</b> <a href="SystemParameters_8h_source.html#l00029">SystemParameters.h:29</a></div></div>
<div class="ttc" id="anamespaceripple_html_a2c550f167665d94744b297523ff07de2"><div class="ttname"><a href="namespaceripple.html#a2c550f167665d94744b297523ff07de2">ripple::XRP_LEDGER_EARLIEST_SEQ</a></div><div class="ttdeci">static constexpr std::uint32_t XRP_LEDGER_EARLIEST_SEQ</div><div class="ttdoc">The XRP ledger network's earliest allowed sequence.</div><div class="ttdef"><b>Definition</b> <a href="SystemParameters_8h_source.html#l00051">SystemParameters.h:51</a></div></div>
<div class="ttc" id="anamespaceripple_html_a4ba7590b028e34be0d0a8f0777ec3253"><div class="ttname"><a href="namespaceripple.html#a4ba7590b028e34be0d0a8f0777ec3253">ripple::systemCurrencyCode</a></div><div class="ttdeci">static std::string const &amp; systemCurrencyCode()</div><div class="ttdef"><b>Definition</b> <a href="SystemParameters_8h_source.html#l00044">SystemParameters.h:44</a></div></div>
<div class="ttc" id="anamespaceripple_html_a558b17d6addfbe66741d3f5282292d94"><div class="ttname"><a href="namespaceripple.html#a558b17d6addfbe66741d3f5282292d94">ripple::isLegalAmountSigned</a></div><div class="ttdeci">bool isLegalAmountSigned(XRPAmount const &amp;amount)</div><div class="ttdoc">Returns true if the absolute value of the amount does not exceed the initial XRP in existence.</div><div class="ttdef"><b>Definition</b> <a href="SystemParameters_8h_source.html#l00037">SystemParameters.h:37</a></div></div>
<div class="ttc" id="anamespaceripple_html_a55a2a537e79363b71783d5f6eaca5abf"><div class="ttname"><a href="namespaceripple.html#a55a2a537e79363b71783d5f6eaca5abf">ripple::INITIAL_XRP</a></div><div class="ttdeci">constexpr XRPAmount INITIAL_XRP</div><div class="ttdoc">Configure the native currency.</div><div class="ttdef"><b>Definition</b> <a href="SystemParameters_8h_source.html#l00025">SystemParameters.h:25</a></div></div>
<div class="ttc" id="anamespaceripple_html_a6fc7a232cc9b90d4b5846057977fcf63"><div class="ttname"><a href="namespaceripple.html#a6fc7a232cc9b90d4b5846057977fcf63">ripple::XRP_LEDGER_EARLIEST_FEES</a></div><div class="ttdeci">static constexpr std::uint32_t XRP_LEDGER_EARLIEST_FEES</div><div class="ttdoc">The XRP Ledger mainnet's earliest ledger with a FeeSettings object.</div><div class="ttdef"><b>Definition</b> <a href="SystemParameters_8h_source.html#l00055">SystemParameters.h:55</a></div></div>
<div class="ttc" id="anamespaceripple_html_adab0af0c68aad5308660cf4738759771"><div class="ttname"><a href="namespaceripple.html#adab0af0c68aad5308660cf4738759771">ripple::amendmentMajorityCalcThreshold</a></div><div class="ttdeci">constexpr std::ratio&lt; 80, 100 &gt; amendmentMajorityCalcThreshold</div><div class="ttdoc">The minimum amount of support an amendment should have.</div><div class="ttdef"><b>Definition</b> <a href="SystemParameters_8h_source.html#l00058">SystemParameters.h:58</a></div></div>
<div class="ttc" id="anamespaceripple_html_afa493631a6ea5b71b91ceb86576fc328"><div class="ttname"><a href="namespaceripple.html#afa493631a6ea5b71b91ceb86576fc328">ripple::DROPS_PER_XRP</a></div><div class="ttdeci">constexpr XRPAmount DROPS_PER_XRP</div><div class="ttdoc">Number of drops per 1 XRP.</div><div class="ttdef"><b>Definition</b> <a href="XRPAmount_8h_source.html#l00240">XRPAmount.h:240</a></div></div>
<div class="ttc" id="aratio_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/ratio/ratio.html">std::ratio</a></div></div>
<div class="ttc" id="astring_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/header/string.html">string</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>