Files
rippled/PeerfinderConfig_8cpp_source.html
2026-01-28 10:13:01 -08:00

257 lines
44 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: PeerfinderConfig.cpp 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_89046728185f0c274a4164d3e2cb38fb.html">peerfinder</a></li><li class="navelem"><a class="el" href="dir_e9607b4c59cebecf2224e361d8d6d362.html">detail</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">PeerfinderConfig.cpp</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">#include &lt;xrpld/peerfinder/PeerfinderManager.h&gt;</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#include &lt;xrpld/peerfinder/detail/Tuning.h&gt;</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="keyword">namespace </span><a class="code hl_namespace" href="namespacexrpl.html">xrpl</a> {</div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="keyword">namespace </span>PeerFinder {</div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="foldopen" id="foldopen00007" data-start="{" data-end="}">
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"><a class="line" href="structxrpl_1_1PeerFinder_1_1Config.html#a302243a6986bd66f42a5b8378968bf82"> 7</a></span><a class="code hl_function" href="structxrpl_1_1PeerFinder_1_1Config.html#a302243a6986bd66f42a5b8378968bf82">Config::Config</a>()</div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> : maxPeers(Tuning::defaultMaxPeers)</div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> , outPeers(calcOutPeers())</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> , inPeers(0)</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> , wantIncoming(true)</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> , autoConnect(true)</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> , listeningPort(0)</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> , ipLimit(0)</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span>{</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span>}</div>
</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="keywordtype">bool</span></div>
<div class="foldopen" id="foldopen00019" data-start="{" data-end="};">
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"><a class="line" href="structxrpl_1_1PeerFinder_1_1Config.html#afb682cfc22bdb3d6e89c7c1b2e2b514a"> 19</a></span><a class="code hl_function" href="namespacexrpl_1_1PeerFinder.html#ae4e01f4d07a9bd7e412802daac4e0cac">operator==</a>(<a class="code hl_struct" href="structxrpl_1_1PeerFinder_1_1Config.html">Config</a> <span class="keyword">const</span>&amp; lhs, <a class="code hl_struct" href="structxrpl_1_1PeerFinder_1_1Config.html">Config</a> <span class="keyword">const</span>&amp; rhs)</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span>{</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordflow">return</span> lhs.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a9b21c14047d277cc5c67ae0b85878b18">autoConnect</a> == rhs.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a9b21c14047d277cc5c67ae0b85878b18">autoConnect</a> &amp;&amp; lhs.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#afc97f118b707dc0da721e2dc7aa53ae8">peerPrivate</a> == rhs.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#afc97f118b707dc0da721e2dc7aa53ae8">peerPrivate</a> &amp;&amp;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> lhs.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a9a6f283b4758c763a710adcc1c0641d1">wantIncoming</a> == rhs.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a9a6f283b4758c763a710adcc1c0641d1">wantIncoming</a> &amp;&amp; lhs.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#aac61445105a5fecf0ced2f843137791c">inPeers</a> == rhs.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#aac61445105a5fecf0ced2f843137791c">inPeers</a> &amp;&amp; lhs.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a0a01378cc1b3c761e8c328fa1096ceff">maxPeers</a> == rhs.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a0a01378cc1b3c761e8c328fa1096ceff">maxPeers</a> &amp;&amp;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> lhs.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a13c63f743293e2d53e487ae9e6f511c1">outPeers</a> == rhs.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a13c63f743293e2d53e487ae9e6f511c1">outPeers</a> &amp;&amp; lhs.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#aa767d49c1e249deb8f32a97b159a0bdd">features</a> == lhs.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#aa767d49c1e249deb8f32a97b159a0bdd">features</a> &amp;&amp; lhs.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a10a9d0f2fa475dcdee0ce2f692d16db3">ipLimit</a> == rhs.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a10a9d0f2fa475dcdee0ce2f692d16db3">ipLimit</a> &amp;&amp;</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> lhs.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#ac224bb5b2242526d581351b0e3d3344a">listeningPort</a> == rhs.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#ac224bb5b2242526d581351b0e3d3344a">listeningPort</a>;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span>}</div>
</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a></div>
<div class="foldopen" id="foldopen00028" data-start="{" data-end="}">
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="structxrpl_1_1PeerFinder_1_1Config.html#aca26e4a244160a684634d001a943aac6"> 28</a></span><a class="code hl_function" href="structxrpl_1_1PeerFinder_1_1Config.html#aca26e4a244160a684634d001a943aac6">Config::calcOutPeers</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="keyword"></span>{</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" href="http://en.cppreference.com/w/cpp/algorithm/max.html">std::max</a>((<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a0a01378cc1b3c761e8c328fa1096ceff">maxPeers</a> * <a class="code hl_enumvalue" href="namespacexrpl_1_1PeerFinder_1_1Tuning.html#addf8bda62b973c4f4c2e73de15da7793a03acbc5e852049da50e185590475d96f">Tuning::outPercent</a> + 50) / 100, <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a>(<a class="code hl_enumvalue" href="namespacexrpl_1_1PeerFinder_1_1Tuning.html#addf8bda62b973c4f4c2e73de15da7793a6eb717b8e4b43ab050690773eb4e6e3b">Tuning::minOutCount</a>));</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span>}</div>
</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="keywordtype">void</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="structxrpl_1_1PeerFinder_1_1Config.html#a6f948ba1e8ff2c1bc65ab5b4689b5a7e"> 34</a></span><a class="code hl_function" href="structxrpl_1_1PeerFinder_1_1Config.html#a6f948ba1e8ff2c1bc65ab5b4689b5a7e">Config::applyTuning</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">if</span> (<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a10a9d0f2fa475dcdee0ce2f692d16db3">ipLimit</a> == 0)</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> {</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="comment">// Unless a limit is explicitly set, we allow between</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="comment">// 2 and 5 connections from non RFC-1918 &quot;private&quot;</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="comment">// IP addresses.</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a10a9d0f2fa475dcdee0ce2f692d16db3">ipLimit</a> = 2;</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> </div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#aac61445105a5fecf0ced2f843137791c">inPeers</a> &gt; <a class="code hl_enumvalue" href="namespacexrpl_1_1PeerFinder_1_1Tuning.html#addf8bda62b973c4f4c2e73de15da7793a93978bfc67cb666da9046161988357b7">Tuning::defaultMaxPeers</a>)</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a10a9d0f2fa475dcdee0ce2f692d16db3">ipLimit</a> += <a class="code hl_functionRef" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a>(5, <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#aac61445105a5fecf0ced2f843137791c">inPeers</a> / <a class="code hl_enumvalue" href="namespacexrpl_1_1PeerFinder_1_1Tuning.html#addf8bda62b973c4f4c2e73de15da7793a93978bfc67cb666da9046161988357b7">Tuning::defaultMaxPeers</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> </div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="comment">// We don&#39;t allow a single IP to consume all incoming slots,</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="comment">// unless we only have one incoming slot available.</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a10a9d0f2fa475dcdee0ce2f692d16db3">ipLimit</a> = <a class="code hl_functionRef" href="http://en.cppreference.com/w/cpp/algorithm/max.html">std::max</a>(1, <a class="code hl_functionRef" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a>(<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a10a9d0f2fa475dcdee0ce2f692d16db3">ipLimit</a>, <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#aac61445105a5fecf0ced2f843137791c">inPeers</a> / 2)));</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span>}</div>
</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> </div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="keywordtype">void</span></div>
<div class="foldopen" id="foldopen00053" data-start="{" data-end="}">
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="structxrpl_1_1PeerFinder_1_1Config.html#a196d5eab632bf60d09bcc9a4b1ab3cdd"> 53</a></span><a class="code hl_function" href="structxrpl_1_1PeerFinder_1_1Config.html#a196d5eab632bf60d09bcc9a4b1ab3cdd">Config::onWrite</a>(<a class="code hl_class" href="classbeast_1_1PropertyStream_1_1Map.html">beast::PropertyStream::Map</a>&amp; map)</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span>{</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> map[<span class="stringliteral">&quot;max_peers&quot;</span>] = <a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a0a01378cc1b3c761e8c328fa1096ceff">maxPeers</a>;</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> map[<span class="stringliteral">&quot;out_peers&quot;</span>] = <a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a13c63f743293e2d53e487ae9e6f511c1">outPeers</a>;</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> map[<span class="stringliteral">&quot;want_incoming&quot;</span>] = <a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a9a6f283b4758c763a710adcc1c0641d1">wantIncoming</a>;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> map[<span class="stringliteral">&quot;auto_connect&quot;</span>] = <a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a9b21c14047d277cc5c67ae0b85878b18">autoConnect</a>;</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> map[<span class="stringliteral">&quot;port&quot;</span>] = <a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#ac224bb5b2242526d581351b0e3d3344a">listeningPort</a>;</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> map[<span class="stringliteral">&quot;features&quot;</span>] = <a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#aa767d49c1e249deb8f32a97b159a0bdd">features</a>;</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> map[<span class="stringliteral">&quot;ip_limit&quot;</span>] = <a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a10a9d0f2fa475dcdee0ce2f692d16db3">ipLimit</a>;</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span>}</div>
</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> </div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span><a class="code hl_struct" href="structxrpl_1_1PeerFinder_1_1Config.html">Config</a></div>
<div class="foldopen" id="foldopen00065" data-start="{" data-end="}">
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="structxrpl_1_1PeerFinder_1_1Config.html#ab89a42658c83f9d960e14064411d8e7f"> 65</a></span><a class="code hl_function" href="structxrpl_1_1PeerFinder_1_1Config.html#ab89a42658c83f9d960e14064411d8e7f">Config::makeConfig</a>(<a class="code hl_class" href="classxrpl_1_1Config.html">xrpl::Config</a> <span class="keyword">const</span>&amp; cfg, <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a> port, <span class="keywordtype">bool</span> validationPublicKey, <span class="keywordtype">int</span> ipLimit)</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span>{</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <a class="code hl_struct" href="structxrpl_1_1PeerFinder_1_1Config.html">PeerFinder::Config</a> config;</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> </div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#afc97f118b707dc0da721e2dc7aa53ae8">peerPrivate</a> = cfg.<a class="code hl_variable" href="classxrpl_1_1Config.html#ab11b3bac401be6d47b8aaf7e294b9336">PEER_PRIVATE</a>;</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> </div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="comment">// Servers with peer privacy don&#39;t want to allow incoming connections</span></div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a9a6f283b4758c763a710adcc1c0641d1">wantIncoming</a> = (!config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#afc97f118b707dc0da721e2dc7aa53ae8">peerPrivate</a>) &amp;&amp; (port != 0);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> </div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keywordflow">if</span> (!cfg.<a class="code hl_variable" href="classxrpl_1_1Config.html#a53c0917afe5b954ee38ab97501411476">PEERS_OUT_MAX</a> &amp;&amp; !cfg.<a class="code hl_variable" href="classxrpl_1_1Config.html#a2e578a300f818e7e9413adc95e0414fd">PEERS_IN_MAX</a>)</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> {</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keywordflow">if</span> (cfg.<a class="code hl_variable" href="classxrpl_1_1Config.html#ac1f7e9d83189dd14c83128043dfeea25">PEERS_MAX</a> != 0)</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a0a01378cc1b3c761e8c328fa1096ceff">maxPeers</a> = cfg.<a class="code hl_variable" href="classxrpl_1_1Config.html#ac1f7e9d83189dd14c83128043dfeea25">PEERS_MAX</a>;</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> </div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordflow">if</span> (config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a0a01378cc1b3c761e8c328fa1096ceff">maxPeers</a> &lt; <a class="code hl_enumvalue" href="namespacexrpl_1_1PeerFinder_1_1Tuning.html#addf8bda62b973c4f4c2e73de15da7793a6eb717b8e4b43ab050690773eb4e6e3b">Tuning::minOutCount</a>)</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a0a01378cc1b3c761e8c328fa1096ceff">maxPeers</a> = <a class="code hl_enumvalue" href="namespacexrpl_1_1PeerFinder_1_1Tuning.html#addf8bda62b973c4f4c2e73de15da7793a6eb717b8e4b43ab050690773eb4e6e3b">Tuning::minOutCount</a>;</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a13c63f743293e2d53e487ae9e6f511c1">outPeers</a> = config.<a class="code hl_function" href="structxrpl_1_1PeerFinder_1_1Config.html#aca26e4a244160a684634d001a943aac6">calcOutPeers</a>();</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> </div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="comment">// Calculate the number of outbound peers we want. If we dont want</span></div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="comment">// or can&#39;t accept incoming, this will simply be equal to maxPeers.</span></div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">if</span> (!config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a9a6f283b4758c763a710adcc1c0641d1">wantIncoming</a>)</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a13c63f743293e2d53e487ae9e6f511c1">outPeers</a> = config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a0a01378cc1b3c761e8c328fa1096ceff">maxPeers</a>;</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> </div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="comment">// Calculate the largest number of inbound connections we could</span></div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="comment">// take.</span></div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordflow">if</span> (config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a0a01378cc1b3c761e8c328fa1096ceff">maxPeers</a> &gt;= config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a13c63f743293e2d53e487ae9e6f511c1">outPeers</a>)</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#aac61445105a5fecf0ced2f843137791c">inPeers</a> = config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a0a01378cc1b3c761e8c328fa1096ceff">maxPeers</a> - config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a13c63f743293e2d53e487ae9e6f511c1">outPeers</a>;</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="keywordflow">else</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#aac61445105a5fecf0ced2f843137791c">inPeers</a> = 0;</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> }</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keywordflow">else</span></div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> {</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a13c63f743293e2d53e487ae9e6f511c1">outPeers</a> = cfg.<a class="code hl_variable" href="classxrpl_1_1Config.html#a53c0917afe5b954ee38ab97501411476">PEERS_OUT_MAX</a>;</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#aac61445105a5fecf0ced2f843137791c">inPeers</a> = cfg.<a class="code hl_variable" href="classxrpl_1_1Config.html#a2e578a300f818e7e9413adc95e0414fd">PEERS_IN_MAX</a>;</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a0a01378cc1b3c761e8c328fa1096ceff">maxPeers</a> = 0;</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> }</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> </div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="comment">// This will cause servers configured as validators to request that</span></div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="comment">// peers they connect to never report their IP address. We set this</span></div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="comment">// after we set the &#39;wantIncoming&#39; because we want a &quot;soft&quot; version</span></div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="comment">// of peer privacy unless the operator explicitly asks for it.</span></div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keywordflow">if</span> (validationPublicKey)</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#afc97f118b707dc0da721e2dc7aa53ae8">peerPrivate</a> = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> </div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="comment">// if it&#39;s a private peer or we are running as standalone</span></div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="comment">// automatic connections would defeat the purpose.</span></div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a9b21c14047d277cc5c67ae0b85878b18">autoConnect</a> = !cfg.<a class="code hl_function" href="classxrpl_1_1Config.html#a40902c440ca8e76103c967661621b20a">standalone</a>() &amp;&amp; !cfg.<a class="code hl_variable" href="classxrpl_1_1Config.html#ab11b3bac401be6d47b8aaf7e294b9336">PEER_PRIVATE</a>;</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#ac224bb5b2242526d581351b0e3d3344a">listeningPort</a> = port;</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#aa767d49c1e249deb8f32a97b159a0bdd">features</a> = <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> config.<a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a10a9d0f2fa475dcdee0ce2f692d16db3">ipLimit</a> = <a class="code hl_variable" href="structxrpl_1_1PeerFinder_1_1Config.html#a10a9d0f2fa475dcdee0ce2f692d16db3">ipLimit</a>;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> </div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="comment">// Enforce business rules</span></div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> config.<a class="code hl_function" href="structxrpl_1_1PeerFinder_1_1Config.html#a6f948ba1e8ff2c1bc65ab5b4689b5a7e">applyTuning</a>();</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> </div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordflow">return</span> config;</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span>}</div>
</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> </div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span>} <span class="comment">// namespace PeerFinder</span></div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span>} <span class="comment">// namespace xrpl</span></div>
<div class="ttc" id="aclassbeast_1_1PropertyStream_1_1Map_html"><div class="ttname"><a href="classbeast_1_1PropertyStream_1_1Map.html">beast::PropertyStream::Map</a></div><div class="ttdef"><b>Definition</b> <a href="PropertyStream_8h_source.html#l00203">PropertyStream.h:204</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Config_html"><div class="ttname"><a href="classxrpl_1_1Config.html">xrpl::Config</a></div><div class="ttdef"><b>Definition</b> <a href="Config_8h_source.html#l00066">Config.h:67</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Config_html_a2e578a300f818e7e9413adc95e0414fd"><div class="ttname"><a href="classxrpl_1_1Config.html#a2e578a300f818e7e9413adc95e0414fd">xrpl::Config::PEERS_IN_MAX</a></div><div class="ttdeci">std::size_t PEERS_IN_MAX</div><div class="ttdef"><b>Definition</b> <a href="Config_8h_source.html#l00163">Config.h:163</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Config_html_a40902c440ca8e76103c967661621b20a"><div class="ttname"><a href="classxrpl_1_1Config.html#a40902c440ca8e76103c967661621b20a">xrpl::Config::standalone</a></div><div class="ttdeci">bool standalone() const</div><div class="ttdef"><b>Definition</b> <a href="Config_8h_source.html#l00312">Config.h:312</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Config_html_a53c0917afe5b954ee38ab97501411476"><div class="ttname"><a href="classxrpl_1_1Config.html#a53c0917afe5b954ee38ab97501411476">xrpl::Config::PEERS_OUT_MAX</a></div><div class="ttdeci">std::size_t PEERS_OUT_MAX</div><div class="ttdef"><b>Definition</b> <a href="Config_8h_source.html#l00162">Config.h:162</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Config_html_ab11b3bac401be6d47b8aaf7e294b9336"><div class="ttname"><a href="classxrpl_1_1Config.html#ab11b3bac401be6d47b8aaf7e294b9336">xrpl::Config::PEER_PRIVATE</a></div><div class="ttdeci">bool PEER_PRIVATE</div><div class="ttdef"><b>Definition</b> <a href="Config_8h_source.html#l00155">Config.h:155</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Config_html_ac1f7e9d83189dd14c83128043dfeea25"><div class="ttname"><a href="classxrpl_1_1Config.html#ac1f7e9d83189dd14c83128043dfeea25">xrpl::Config::PEERS_MAX</a></div><div class="ttdeci">std::size_t PEERS_MAX</div><div class="ttdef"><b>Definition</b> <a href="Config_8h_source.html#l00161">Config.h:161</a></div></div>
<div class="ttc" id="ainteger_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a></div></div>
<div class="ttc" id="amax_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/max.html">std::max</a></div><div class="ttdeci">T max(T... args)</div></div>
<div class="ttc" id="amin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a></div><div class="ttdeci">T min(T... args)</div></div>
<div class="ttc" id="anamespacexrpl_1_1PeerFinder_1_1Tuning_html_addf8bda62b973c4f4c2e73de15da7793a03acbc5e852049da50e185590475d96f"><div class="ttname"><a href="namespacexrpl_1_1PeerFinder_1_1Tuning.html#addf8bda62b973c4f4c2e73de15da7793a03acbc5e852049da50e185590475d96f">xrpl::PeerFinder::Tuning::outPercent</a></div><div class="ttdeci">@ outPercent</div><div class="ttdef"><b>Definition</b> <a href="src_2xrpld_2peerfinder_2detail_2Tuning_8h_source.html#l00039">src/xrpld/peerfinder/detail/Tuning.h:33</a></div></div>
<div class="ttc" id="anamespacexrpl_1_1PeerFinder_1_1Tuning_html_addf8bda62b973c4f4c2e73de15da7793a6eb717b8e4b43ab050690773eb4e6e3b"><div class="ttname"><a href="namespacexrpl_1_1PeerFinder_1_1Tuning.html#addf8bda62b973c4f4c2e73de15da7793a6eb717b8e4b43ab050690773eb4e6e3b">xrpl::PeerFinder::Tuning::minOutCount</a></div><div class="ttdeci">@ minOutCount</div><div class="ttdef"><b>Definition</b> <a href="src_2xrpld_2peerfinder_2detail_2Tuning_8h_source.html#l00043">src/xrpld/peerfinder/detail/Tuning.h:40</a></div></div>
<div class="ttc" id="anamespacexrpl_1_1PeerFinder_1_1Tuning_html_addf8bda62b973c4f4c2e73de15da7793a93978bfc67cb666da9046161988357b7"><div class="ttname"><a href="namespacexrpl_1_1PeerFinder_1_1Tuning.html#addf8bda62b973c4f4c2e73de15da7793a93978bfc67cb666da9046161988357b7">xrpl::PeerFinder::Tuning::defaultMaxPeers</a></div><div class="ttdeci">@ defaultMaxPeers</div><div class="ttdef"><b>Definition</b> <a href="src_2xrpld_2peerfinder_2detail_2Tuning_8h_source.html#l00050">src/xrpld/peerfinder/detail/Tuning.h:44</a></div></div>
<div class="ttc" id="anamespacexrpl_1_1PeerFinder_html_ae4e01f4d07a9bd7e412802daac4e0cac"><div class="ttname"><a href="namespacexrpl_1_1PeerFinder.html#ae4e01f4d07a9bd7e412802daac4e0cac">xrpl::PeerFinder::operator==</a></div><div class="ttdeci">bool operator==(Endpoint const &amp;a, Endpoint const &amp;b)</div><div class="ttdef"><b>Definition</b> <a href="Livecache__test_8cpp_source.html#l00016">Livecache_test.cpp:16</a></div></div>
<div class="ttc" id="anamespacexrpl_html"><div class="ttname"><a href="namespacexrpl.html">xrpl</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="asize_t_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a></div></div>
<div class="ttc" id="astructxrpl_1_1PeerFinder_1_1Config_html"><div class="ttname"><a href="structxrpl_1_1PeerFinder_1_1Config.html">xrpl::PeerFinder::Config</a></div><div class="ttdoc">PeerFinder configuration settings.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00025">PeerfinderManager.h:26</a></div></div>
<div class="ttc" id="astructxrpl_1_1PeerFinder_1_1Config_html_a0a01378cc1b3c761e8c328fa1096ceff"><div class="ttname"><a href="structxrpl_1_1PeerFinder_1_1Config.html#a0a01378cc1b3c761e8c328fa1096ceff">xrpl::PeerFinder::Config::maxPeers</a></div><div class="ttdeci">std::size_t maxPeers</div><div class="ttdoc">The largest number of public peer slots to allow.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00031">PeerfinderManager.h:31</a></div></div>
<div class="ttc" id="astructxrpl_1_1PeerFinder_1_1Config_html_a10a9d0f2fa475dcdee0ce2f692d16db3"><div class="ttname"><a href="structxrpl_1_1PeerFinder_1_1Config.html#a10a9d0f2fa475dcdee0ce2f692d16db3">xrpl::PeerFinder::Config::ipLimit</a></div><div class="ttdeci">int ipLimit</div><div class="ttdoc">Limit how many incoming connections we allow per IP.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00061">PeerfinderManager.h:61</a></div></div>
<div class="ttc" id="astructxrpl_1_1PeerFinder_1_1Config_html_a13c63f743293e2d53e487ae9e6f511c1"><div class="ttname"><a href="structxrpl_1_1PeerFinder_1_1Config.html#a13c63f743293e2d53e487ae9e6f511c1">xrpl::PeerFinder::Config::outPeers</a></div><div class="ttdeci">std::size_t outPeers</div><div class="ttdoc">The number of automatic outbound connections to maintain.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00037">PeerfinderManager.h:37</a></div></div>
<div class="ttc" id="astructxrpl_1_1PeerFinder_1_1Config_html_a196d5eab632bf60d09bcc9a4b1ab3cdd"><div class="ttname"><a href="structxrpl_1_1PeerFinder_1_1Config.html#a196d5eab632bf60d09bcc9a4b1ab3cdd">xrpl::PeerFinder::Config::onWrite</a></div><div class="ttdeci">void onWrite(beast::PropertyStream::Map &amp;map)</div><div class="ttdoc">Write the configuration into a property stream.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderConfig_8cpp_source.html#l00053">PeerfinderConfig.cpp:53</a></div></div>
<div class="ttc" id="astructxrpl_1_1PeerFinder_1_1Config_html_a302243a6986bd66f42a5b8378968bf82"><div class="ttname"><a href="structxrpl_1_1PeerFinder_1_1Config.html#a302243a6986bd66f42a5b8378968bf82">xrpl::PeerFinder::Config::Config</a></div><div class="ttdeci">Config()</div><div class="ttdoc">Create a configuration with default values.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderConfig_8cpp_source.html#l00007">PeerfinderConfig.cpp:7</a></div></div>
<div class="ttc" id="astructxrpl_1_1PeerFinder_1_1Config_html_a6f948ba1e8ff2c1bc65ab5b4689b5a7e"><div class="ttname"><a href="structxrpl_1_1PeerFinder_1_1Config.html#a6f948ba1e8ff2c1bc65ab5b4689b5a7e">xrpl::PeerFinder::Config::applyTuning</a></div><div class="ttdeci">void applyTuning()</div><div class="ttdoc">Adjusts the values so they follow the business rules.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderConfig_8cpp_source.html#l00034">PeerfinderConfig.cpp:34</a></div></div>
<div class="ttc" id="astructxrpl_1_1PeerFinder_1_1Config_html_a9a6f283b4758c763a710adcc1c0641d1"><div class="ttname"><a href="structxrpl_1_1PeerFinder_1_1Config.html#a9a6f283b4758c763a710adcc1c0641d1">xrpl::PeerFinder::Config::wantIncoming</a></div><div class="ttdeci">bool wantIncoming</div><div class="ttdoc">true if we want to accept incoming connections.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00049">PeerfinderManager.h:49</a></div></div>
<div class="ttc" id="astructxrpl_1_1PeerFinder_1_1Config_html_a9b21c14047d277cc5c67ae0b85878b18"><div class="ttname"><a href="structxrpl_1_1PeerFinder_1_1Config.html#a9b21c14047d277cc5c67ae0b85878b18">xrpl::PeerFinder::Config::autoConnect</a></div><div class="ttdeci">bool autoConnect</div><div class="ttdoc">true if we want to establish connections automatically</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00052">PeerfinderManager.h:52</a></div></div>
<div class="ttc" id="astructxrpl_1_1PeerFinder_1_1Config_html_aa767d49c1e249deb8f32a97b159a0bdd"><div class="ttname"><a href="structxrpl_1_1PeerFinder_1_1Config.html#aa767d49c1e249deb8f32a97b159a0bdd">xrpl::PeerFinder::Config::features</a></div><div class="ttdeci">std::string features</div><div class="ttdoc">The set of features we advertise.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00058">PeerfinderManager.h:58</a></div></div>
<div class="ttc" id="astructxrpl_1_1PeerFinder_1_1Config_html_aac61445105a5fecf0ced2f843137791c"><div class="ttname"><a href="structxrpl_1_1PeerFinder_1_1Config.html#aac61445105a5fecf0ced2f843137791c">xrpl::PeerFinder::Config::inPeers</a></div><div class="ttdeci">std::size_t inPeers</div><div class="ttdoc">The number of automatic inbound connections to maintain.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00043">PeerfinderManager.h:43</a></div></div>
<div class="ttc" id="astructxrpl_1_1PeerFinder_1_1Config_html_ab89a42658c83f9d960e14064411d8e7f"><div class="ttname"><a href="structxrpl_1_1PeerFinder_1_1Config.html#ab89a42658c83f9d960e14064411d8e7f">xrpl::PeerFinder::Config::makeConfig</a></div><div class="ttdeci">static Config makeConfig(xrpl::Config const &amp;config, std::uint16_t port, bool validationPublicKey, int ipLimit)</div><div class="ttdoc">Make PeerFinder::Config from configuration parameters.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderConfig_8cpp_source.html#l00065">PeerfinderConfig.cpp:65</a></div></div>
<div class="ttc" id="astructxrpl_1_1PeerFinder_1_1Config_html_ac224bb5b2242526d581351b0e3d3344a"><div class="ttname"><a href="structxrpl_1_1PeerFinder_1_1Config.html#ac224bb5b2242526d581351b0e3d3344a">xrpl::PeerFinder::Config::listeningPort</a></div><div class="ttdeci">std::uint16_t listeningPort</div><div class="ttdoc">The listening port number.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00055">PeerfinderManager.h:55</a></div></div>
<div class="ttc" id="astructxrpl_1_1PeerFinder_1_1Config_html_aca26e4a244160a684634d001a943aac6"><div class="ttname"><a href="structxrpl_1_1PeerFinder_1_1Config.html#aca26e4a244160a684634d001a943aac6">xrpl::PeerFinder::Config::calcOutPeers</a></div><div class="ttdeci">std::size_t calcOutPeers() const</div><div class="ttdoc">Returns a suitable value for outPeers according to the rules.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderConfig_8cpp_source.html#l00028">PeerfinderConfig.cpp:28</a></div></div>
<div class="ttc" id="astructxrpl_1_1PeerFinder_1_1Config_html_afc97f118b707dc0da721e2dc7aa53ae8"><div class="ttname"><a href="structxrpl_1_1PeerFinder_1_1Config.html#afc97f118b707dc0da721e2dc7aa53ae8">xrpl::PeerFinder::Config::peerPrivate</a></div><div class="ttdeci">bool peerPrivate</div><div class="ttdoc">true if we want our IP address kept private.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00046">PeerfinderManager.h:46</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>