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

508 lines
96 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: LoanBrokerCoverClawback.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_c69db3203fa08a9ff994909ba6ee9783.html">app</a></li><li class="navelem"><a class="el" href="dir_4b2d6f306dc33741b6f38a59a670a446.html">tx</a></li><li class="navelem"><a class="el" href="dir_7b1ffcd2aae1e871efc2e94c72e78699.html">detail</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">LoanBrokerCoverClawback.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/app/tx/detail/LoanBrokerCoverClawback.h&gt;</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">//</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#include &lt;xrpld/app/misc/LendingHelpers.h&gt;</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;xrpl/protocol/STTakesAsset.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="keyword">namespace </span><a class="code hl_namespace" href="namespacexrpl.html">xrpl</a> {</div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keywordtype">bool</span></div>
<div class="foldopen" id="foldopen00010" data-start="{" data-end="}">
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"><a class="line" href="classxrpl_1_1LoanBrokerCoverClawback.html#aec06bdf9c63ec8e27222a7afd0ac36a4"> 10</a></span><a class="code hl_function" href="classxrpl_1_1LoanBrokerCoverClawback.html#aec06bdf9c63ec8e27222a7afd0ac36a4">LoanBrokerCoverClawback::checkExtraFeatures</a>(<a class="code hl_struct" href="structxrpl_1_1PreflightContext.html">PreflightContext</a> <span class="keyword">const</span>&amp; ctx)</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="keywordflow">return</span> <a class="code hl_function" href="namespacexrpl.html#a4c0d6c5117eb6c71f933532d1a216f7b">checkLendingProtocolDependencies</a>(ctx);</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span>}</div>
</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><a class="code hl_class" href="classxrpl_1_1TERSubset.html">NotTEC</a></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="classxrpl_1_1LoanBrokerCoverClawback.html#a812e7b6e404837cd88e7792236f64abd"> 16</a></span><a class="code hl_function" href="classxrpl_1_1LoanBrokerCoverClawback.html#a812e7b6e404837cd88e7792236f64abd">LoanBrokerCoverClawback::preflight</a>(<a class="code hl_struct" href="structxrpl_1_1PreflightContext.html">PreflightContext</a> <span class="keyword">const</span>&amp; ctx)</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">auto</span> <span class="keyword">const</span> brokerID = ctx.<a class="code hl_variable" href="structxrpl_1_1PreflightContext.html#ad1cfd2197bb28468799d62785e974952">tx</a>[~sfLoanBrokerID];</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keyword">auto</span> <span class="keyword">const</span> amount = ctx.<a class="code hl_variable" href="structxrpl_1_1PreflightContext.html#ad1cfd2197bb28468799d62785e974952">tx</a>[~sfAmount];</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">if</span> (!brokerID &amp;&amp; !amount)</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ac8c50610643a4f902b9bb9e42d0b00e6a2d9e286ee2cc7d46dba7d5812daada61">temINVALID</a>;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordflow">if</span> (brokerID &amp;&amp; *brokerID == beast::zero)</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ac8c50610643a4f902b9bb9e42d0b00e6a2d9e286ee2cc7d46dba7d5812daada61">temINVALID</a>;</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> <span class="keywordflow">if</span> (amount)</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> {</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="comment">// XRP has no counterparty, and thus nobody can claw it back</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keywordflow">if</span> (amount-&gt;native())</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ac8c50610643a4f902b9bb9e42d0b00e6aa9a4c76c9c7d2e1fc83581b9ce4d5152">temBAD_AMOUNT</a>;</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="comment">// Zero is OK, and indicates &quot;take it all&quot; (down to the minimum cover)</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keywordflow">if</span> (*amount &lt; beast::zero)</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ac8c50610643a4f902b9bb9e42d0b00e6aa9a4c76c9c7d2e1fc83581b9ce4d5152">temBAD_AMOUNT</a>;</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> </div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="comment">// This should be redundant</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="namespacexrpl.html#a4b4f85373c903b06cac8795afc79820e">isLegalNet</a>(*amount))</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ac8c50610643a4f902b9bb9e42d0b00e6aa9a4c76c9c7d2e1fc83581b9ce4d5152">temBAD_AMOUNT</a>; <span class="comment">// LCOV_EXCL_LINE</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keywordflow">if</span> (!brokerID)</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> (amount-&gt;holds&lt;<a class="code hl_class" href="classxrpl_1_1MPTIssue.html">MPTIssue</a>&gt;())</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ac8c50610643a4f902b9bb9e42d0b00e6a2d9e286ee2cc7d46dba7d5812daada61">temINVALID</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">auto</span> <span class="keyword">const</span> account = ctx.<a class="code hl_variable" href="structxrpl_1_1PreflightContext.html#ad1cfd2197bb28468799d62785e974952">tx</a>[sfAccount];</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="comment">// Since we don&#39;t have a LoanBrokerID, holder _should_ be the loan</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="comment">// broker&#39;s pseudo-account, but we don&#39;t know yet whether it is, so</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="comment">// use a generic placeholder name.</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keyword">auto</span> <span class="keyword">const</span> holder = amount-&gt;getIssuer();</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">if</span> (holder == account || holder == beast::zero)</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ac8c50610643a4f902b9bb9e42d0b00e6a2d9e286ee2cc7d46dba7d5812daada61">temINVALID</a>;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> }</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> </div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#af4adbbe94a1cecf1bd3ad2c76ff1ea3da157dace29a657c58cdeb4f7fa19be976">tesSUCCESS</a>;</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span>}</div>
</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span><a class="code hl_class" href="classxrpl_1_1Expected.html">Expected&lt;uint256, TER&gt;</a></div>
<div class="foldopen" id="foldopen00060" data-start="{" data-end="}">
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="namespacexrpl.html#aa7503a308a843d7cb3f9850a82cfe908"> 60</a></span><a class="code hl_function" href="namespacexrpl.html#aa7503a308a843d7cb3f9850a82cfe908">determineBrokerID</a>(<a class="code hl_class" href="classxrpl_1_1ReadView.html">ReadView</a> <span class="keyword">const</span>&amp; view, <a class="code hl_class" href="classxrpl_1_1STTx.html">STTx</a> <span class="keyword">const</span>&amp; tx)</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span>{</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="comment">// If the broker ID was provided in the transaction, that&#39;s all we</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="comment">// need.</span></div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> <span class="keyword">const</span> brokerID = tx[~sfLoanBrokerID])</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">return</span> *brokerID;</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> <span class="comment">// If the broker ID was not provided, and the amount is either</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="comment">// absent or holds a non-IOU - including MPT, something went wrong,</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="comment">// because that should have been rejected in preflight().</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keyword">auto</span> <span class="keyword">const</span> dstAmount = tx[~sfAmount];</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordflow">if</span> (!dstAmount || !dstAmount-&gt;holds&lt;<a class="code hl_class" href="classxrpl_1_1Issue.html">Issue</a>&gt;())</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordflow">return</span> <a class="code hl_class" href="classxrpl_1_1Unexpected.html">Unexpected</a>{<a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba6869daf531ae5878c65a5095f103ce62">tecINTERNAL</a>}; <span class="comment">// LCOV_EXCL_LINE</span></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="comment">// Every trust line is bidirectional. Both sides are simultaneously</span></div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="comment">// issuer and holder. For this transaction, the Account is acting as</span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="comment">// a holder, and clawing back funds from the LoanBroker</span></div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="comment">// Pseudo-account acting as holder. If the Amount is an IOU, and the</span></div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="comment">// `issuer` field specified in that Amount is a LoanBroker</span></div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="comment">// Pseudo-account, we can get the LoanBrokerID from there.</span></div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="comment">//</span></div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="comment">// Thus, Amount.issuer _should_ be the loan broker&#39;s</span></div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="comment">// pseudo-account, but we don&#39;t know yet whether it is.</span></div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keyword">auto</span> <span class="keyword">const</span> maybePseudo = dstAmount-&gt;getIssuer();</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keyword">auto</span> <span class="keyword">const</span> sle = view.<a class="code hl_function" href="classxrpl_1_1ReadView.html#ae7286da5df8ee36f950cc43fd3a46806">read</a>(<a class="code hl_function" href="namespacexrpl_1_1keylet.html#ac5d7a88f7cef6ac1ddf06020da8ded16">keylet::account</a>(maybePseudo));</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> </div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="comment">// If the account was not found, the transaction can&#39;t go further.</span></div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordflow">if</span> (!sle)</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keywordflow">return</span> <a class="code hl_class" href="classxrpl_1_1Unexpected.html">Unexpected</a>{<a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba348afbc4922cc9b29af76316d5d8a277">tecNO_ENTRY</a>};</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> </div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="comment">// If the account was found, and has a LoanBrokerID (and therefore</span></div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="comment">// is a pseudo-account), that&#39;s the</span></div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="comment">// answer we need.</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> <span class="keyword">const</span> brokerID = sle-&gt;at(~sfLoanBrokerID))</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">return</span> *brokerID;</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> </div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="comment">// If the account does not have a LoanBrokerID, the transaction</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="comment">// can&#39;t go further, even if it&#39;s a different type of Pseudo-account.</span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="keywordflow">return</span> <a class="code hl_class" href="classxrpl_1_1Unexpected.html">Unexpected</a>{<a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba51bfb4a3d241d816dbbcb77147125f16">tecOBJECT_NOT_FOUND</a>};</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="comment">// Or tecWRONG_ASSET?</span></div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span>}</div>
</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>Expected&lt;Asset, TER&gt;</div>
<div class="foldopen" id="foldopen00103" data-start="{" data-end="}">
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"><a class="line" href="namespacexrpl.html#afb78c3ff6c70477641d17524607a5dce"> 103</a></span><a class="code hl_function" href="namespacexrpl.html#afb78c3ff6c70477641d17524607a5dce">determineAsset</a>(</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <a class="code hl_class" href="classxrpl_1_1ReadView.html">ReadView</a> <span class="keyword">const</span>&amp; view,</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <a class="code hl_class" href="classxrpl_1_1base__uint.html">AccountID</a> <span class="keyword">const</span>&amp; account,</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <a class="code hl_class" href="classxrpl_1_1base__uint.html">AccountID</a> <span class="keyword">const</span>&amp; brokerPseudoAccountID,</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <a class="code hl_class" href="classxrpl_1_1STAmount.html">STAmount</a> <span class="keyword">const</span>&amp; amount)</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="keywordflow">if</span> (amount.holds&lt;<a class="code hl_class" href="classxrpl_1_1MPTIssue.html">MPTIssue</a>&gt;())</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="keywordflow">return</span> amount.asset();</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> </div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="comment">// An IOU has an issue, which could be either end of the trust line.</span></div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="comment">// This check only applies to IOUs</span></div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="keyword">auto</span> <span class="keyword">const</span> holder = amount.getIssuer();</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">// holder can be the submitting account (the issuer of the asset) if a</span></div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="comment">// LoanBrokerID was provided in the transaction.</span></div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordflow">if</span> (holder == account)</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> {</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keywordflow">return</span> amount.asset();</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="keywordflow">else</span> <span class="keywordflow">if</span> (holder == brokerPseudoAccountID)</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> {</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="comment">// We want the asset to match the vault asset, so use the account as the</span></div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="comment">// issuer</span></div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keywordflow">return</span> <a class="code hl_class" href="classxrpl_1_1Issue.html">Issue</a>{amount.getCurrency(), account};</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> }</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="keywordflow">else</span></div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <span class="keywordflow">return</span> <a class="code hl_class" href="classxrpl_1_1Unexpected.html">Unexpected</a>(<a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba1957d1d9fc2b8195c8717cd9b85ce5e3">tecWRONG_ASSET</a>);</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span>}</div>
</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> </div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span>Expected&lt;STAmount, TER&gt;</div>
<div class="foldopen" id="foldopen00133" data-start="{" data-end="}">
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"><a class="line" href="namespacexrpl.html#aabcbb0bfb4cf835b208547c7d281727a"> 133</a></span><a class="code hl_function" href="namespacexrpl.html#aabcbb0bfb4cf835b208547c7d281727a">determineClawAmount</a>(<a class="code hl_class" href="classxrpl_1_1STLedgerEntry.html">SLE</a> <span class="keyword">const</span>&amp; sleBroker, <a class="code hl_class" href="classxrpl_1_1Asset.html">Asset</a> <span class="keyword">const</span>&amp; vaultAsset, <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional&lt;STAmount&gt;</a> <span class="keyword">const</span>&amp; amount)</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span>{</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="keyword">auto</span> <span class="keyword">const</span> maxClawAmount = [&amp;]() {</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <span class="comment">// Always round the minimum required up</span></div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <a class="code hl_class" href="classxrpl_1_1NumberRoundModeGuard.html">NumberRoundModeGuard</a> mg1(<a class="code hl_enumvalue" href="classxrpl_1_1Number.html#a40e08f75077897215c66d102b5b75f95aaf71effcd4dcf7bc7c89bb51e27e8b17">Number::upward</a>);</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keyword">auto</span> <span class="keyword">const</span> minRequiredCover =</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> <a class="code hl_function" href="namespacexrpl.html#a3f56d997a36633a10ca0f17c86113f56">tenthBipsOfValue</a>(sleBroker[sfDebtTotal], <a class="code hl_typedef" href="namespacexrpl.html#a64347051276d9ee7646d93623f5039b4">TenthBips32</a>(sleBroker[sfCoverRateMinimum]));</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="comment">// The subtraction probably won&#39;t round, but round down if it does.</span></div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <a class="code hl_class" href="classxrpl_1_1NumberRoundModeGuard.html">NumberRoundModeGuard</a> mg2(<a class="code hl_enumvalue" href="classxrpl_1_1Number.html#a40e08f75077897215c66d102b5b75f95aefac6c5bd63a85dcee4fc69baf788d40">Number::downward</a>);</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="keywordflow">return</span> sleBroker[sfCoverAvailable] - minRequiredCover;</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> }();</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keywordflow">if</span> (maxClawAmount &lt;= beast::zero)</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <span class="keywordflow">return</span> <a class="code hl_class" href="classxrpl_1_1Unexpected.html">Unexpected</a>(<a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba8479260fa4500bef887fa8e8c9f3c624">tecINSUFFICIENT_FUNDS</a>);</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> </div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="comment">// Use the vaultAsset here, because it will be the right type in all</span></div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <span class="comment">// circumstances. The amount may be an IOU indicating the pseudo-account&#39;s</span></div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="comment">// asset, which is correct, but not what is needed here.</span></div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <span class="keywordflow">if</span> (!amount || *amount == beast::zero)</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <span class="keywordflow">return</span> <a class="code hl_class" href="classxrpl_1_1STAmount.html">STAmount</a>{vaultAsset, maxClawAmount};</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <a class="code hl_class" href="classxrpl_1_1Number.html">Number</a> <span class="keyword">const</span> magnitude{*amount};</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <span class="keywordflow">if</span> (magnitude &gt; maxClawAmount)</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keywordflow">return</span> <a class="code hl_class" href="classxrpl_1_1STAmount.html">STAmount</a>{vaultAsset, maxClawAmount};</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> <span class="keywordflow">return</span> <a class="code hl_class" href="classxrpl_1_1STAmount.html">STAmount</a>{vaultAsset, magnitude};</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span>}</div>
</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> </div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span><span class="keyword">template</span> &lt;Val<span class="keywordtype">id</span>IssueType T&gt;</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span><span class="keyword">static</span> <a class="code hl_typedef" href="namespacexrpl.html#a89ce254d202a943d2f5bad19d88787a5">TER</a></div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"><a class="line" href="namespacexrpl.html#af832afddf294b1b9ef805a9a43f8bd4e"> 160</a></span><a class="code hl_function" href="namespacexrpl.html#a7c08c383d2c90b3825d1dd62b70443d4">preclaimHelper</a>(<a class="code hl_struct" href="structxrpl_1_1PreclaimContext.html">PreclaimContext</a> <span class="keyword">const</span>&amp; ctx, <a class="code hl_class" href="classxrpl_1_1STLedgerEntry.html">SLE</a> <span class="keyword">const</span>&amp; sleIssuer, <a class="code hl_class" href="classxrpl_1_1STAmount.html">STAmount</a> <span class="keyword">const</span>&amp; clawAmount);</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> </div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span><span class="keyword">template</span> &lt;&gt;</div>
<div class="foldopen" id="foldopen00163" data-start="{" data-end="}">
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"><a class="line" href="namespacexrpl.html#a9c154bd34f6c72ed74a4b00809b884d6"> 163</a></span><a class="code hl_class" href="classxrpl_1_1TERSubset.html">TER</a></div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span><a class="code hl_function" href="namespacexrpl.html#a9522b493208dabe4ca01ed631c702d33">preclaimHelper&lt;Issue&gt;</a>(<a class="code hl_struct" href="structxrpl_1_1PreclaimContext.html">PreclaimContext</a> <span class="keyword">const</span>&amp; ctx, <a class="code hl_class" href="classxrpl_1_1STLedgerEntry.html">SLE</a> <span class="keyword">const</span>&amp; sleIssuer, <a class="code hl_class" href="classxrpl_1_1STAmount.html">STAmount</a> <span class="keyword">const</span>&amp; clawAmount)</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span>{</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> <span class="comment">// If AllowTrustLineClawback is not set or NoFreeze is set, return no</span></div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <span class="comment">// permission</span></div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <span class="keywordflow">if</span> (!(sleIssuer.<a class="code hl_function" href="classxrpl_1_1STObject.html#a7c26c5171818777d2ec200dbffc317c5">isFlag</a>(<a class="code hl_enumvalue" href="namespacexrpl.html#ada4805619214865518ed8c0b54a71bc1a02052ddc688667765a5ca728bc2363f4">lsfAllowTrustLineClawback</a>)) || (sleIssuer.<a class="code hl_function" href="classxrpl_1_1STObject.html#a7c26c5171818777d2ec200dbffc317c5">isFlag</a>(<a class="code hl_enumvalue" href="namespacexrpl.html#ada4805619214865518ed8c0b54a71bc1a2fa56ae026467d77bd73e2f5af7f3953">lsfNoFreeze</a>)))</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556bae97a00fb2d2ce5610fcc7cb1ce1e8155">tecNO_PERMISSION</a>;</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> </div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#af4adbbe94a1cecf1bd3ad2c76ff1ea3da157dace29a657c58cdeb4f7fa19be976">tesSUCCESS</a>;</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span>}</div>
</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> </div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span><span class="keyword">template</span> &lt;&gt;</div>
<div class="foldopen" id="foldopen00175" data-start="{" data-end="}">
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"><a class="line" href="namespacexrpl.html#ad1cdeb64dfe2bd9d46734c7256e88791"> 175</a></span><a class="code hl_class" href="classxrpl_1_1TERSubset.html">TER</a></div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span><a class="code hl_function" href="namespacexrpl.html#aed538cdba0392ec46b599d33ea552501">preclaimHelper&lt;MPTIssue&gt;</a>(<a class="code hl_struct" href="structxrpl_1_1PreclaimContext.html">PreclaimContext</a> <span class="keyword">const</span>&amp; ctx, <a class="code hl_class" href="classxrpl_1_1STLedgerEntry.html">SLE</a> <span class="keyword">const</span>&amp; sleIssuer, <a class="code hl_class" href="classxrpl_1_1STAmount.html">STAmount</a> <span class="keyword">const</span>&amp; clawAmount)</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span>{</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> <span class="keyword">auto</span> <span class="keyword">const</span> issuanceKey = <a class="code hl_function" href="namespacexrpl_1_1keylet.html#a77d91a4fd20b17d44ccb32b4e9ae2d9b">keylet::mptIssuance</a>(clawAmount.<a class="code hl_function" href="classxrpl_1_1STAmount.html#a118c2d691f9fe2ab1b9c19441d088c0d">get</a>&lt;<a class="code hl_class" href="classxrpl_1_1MPTIssue.html">MPTIssue</a>&gt;().<a class="code hl_function" href="classxrpl_1_1MPTIssue.html#a5a2ee1ae0ff364ab92677034c3bc09c3">getMptID</a>());</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> <span class="keyword">auto</span> <span class="keyword">const</span> sleIssuance = ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#a4beaff9e60360494328296c6e4367a1c">view</a>.<a class="code hl_function" href="classxrpl_1_1ReadView.html#ae7286da5df8ee36f950cc43fd3a46806">read</a>(issuanceKey);</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> <span class="keywordflow">if</span> (!sleIssuance)</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba51bfb4a3d241d816dbbcb77147125f16">tecOBJECT_NOT_FOUND</a>;</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> </div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> <span class="keywordflow">if</span> (!sleIssuance-&gt;isFlag(<a class="code hl_enumvalue" href="namespacexrpl.html#ada4805619214865518ed8c0b54a71bc1ad6173188f5f849b70d84b480f5800145">lsfMPTCanClawback</a>))</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556bae97a00fb2d2ce5610fcc7cb1ce1e8155">tecNO_PERMISSION</a>;</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> </div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> <span class="comment">// With all the checking already done, this should be impossible</span></div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> <span class="keywordflow">if</span> (sleIssuance-&gt;at(sfIssuer) != sleIssuer[sfAccount])</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba6869daf531ae5878c65a5095f103ce62">tecINTERNAL</a>; <span class="comment">// LCOV_EXCL_LINE</span></div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> </div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#af4adbbe94a1cecf1bd3ad2c76ff1ea3da157dace29a657c58cdeb4f7fa19be976">tesSUCCESS</a>;</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span>}</div>
</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> </div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span><a class="code hl_typedef" href="namespacexrpl.html#a89ce254d202a943d2f5bad19d88787a5">TER</a></div>
<div class="foldopen" id="foldopen00194" data-start="{" data-end="}">
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"><a class="line" href="classxrpl_1_1LoanBrokerCoverClawback.html#a61399b05b900aeb1ad2ca4ef932d3783"> 194</a></span><a class="code hl_function" href="classxrpl_1_1LoanBrokerCoverClawback.html#a61399b05b900aeb1ad2ca4ef932d3783">LoanBrokerCoverClawback::preclaim</a>(<a class="code hl_struct" href="structxrpl_1_1PreclaimContext.html">PreclaimContext</a> <span class="keyword">const</span>&amp; ctx)</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span>{</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <span class="keyword">auto</span> <span class="keyword">const</span>&amp; tx = ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#add7a860523e30f2b1caf7da6fa23ce39">tx</a>;</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> </div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> <span class="keyword">auto</span> <span class="keyword">const</span> account = tx[sfAccount];</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> <span class="keyword">auto</span> <span class="keyword">const</span> findBrokerID = <a class="code hl_function" href="namespacexrpl.html#aa7503a308a843d7cb3f9850a82cfe908">determineBrokerID</a>(ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#a4beaff9e60360494328296c6e4367a1c">view</a>, tx);</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="keywordflow">if</span> (!findBrokerID)</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> <span class="keywordflow">return</span> findBrokerID.error();</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> <span class="keyword">auto</span> <span class="keyword">const</span> brokerID = *findBrokerID;</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> <span class="keyword">auto</span> <span class="keyword">const</span> amount = tx[~sfAmount];</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> </div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> <span class="keyword">auto</span> <span class="keyword">const</span> sleBroker = ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#a4beaff9e60360494328296c6e4367a1c">view</a>.<a class="code hl_function" href="classxrpl_1_1ReadView.html#ae7286da5df8ee36f950cc43fd3a46806">read</a>(<a class="code hl_function" href="namespacexrpl_1_1keylet.html#a5a4a8623c7e5f6f866110316a6b286d4">keylet::loanbroker</a>(brokerID));</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> <span class="keywordflow">if</span> (!sleBroker)</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> {</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> JLOG(ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#ae01ea816e51566ca4c097b8e95a81070">j</a>.<a class="code hl_function" href="classbeast_1_1Journal.html#ad8fefe3e8ad583e1ed1bf02094ac3d8f">warn</a>()) &lt;&lt; <span class="stringliteral">&quot;LoanBroker does not exist.&quot;</span>;</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba348afbc4922cc9b29af76316d5d8a277">tecNO_ENTRY</a>;</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> }</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> </div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> <span class="keyword">auto</span> <span class="keyword">const</span> brokerPseudoAccountID = sleBroker-&gt;at(sfAccount);</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> </div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> <span class="keyword">auto</span> <span class="keyword">const</span> vault = ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#a4beaff9e60360494328296c6e4367a1c">view</a>.<a class="code hl_function" href="classxrpl_1_1ReadView.html#ae7286da5df8ee36f950cc43fd3a46806">read</a>(<a class="code hl_function" href="namespacexrpl_1_1keylet.html#a9a7028770e8d9d38ca198d2096149766">keylet::vault</a>(sleBroker-&gt;at(sfVaultID)));</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> <span class="keywordflow">if</span> (!vault)</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> {</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> <span class="comment">// LCOV_EXCL_START</span></div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> JLOG(ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#ae01ea816e51566ca4c097b8e95a81070">j</a>.<a class="code hl_function" href="classbeast_1_1Journal.html#a3dfb8e2e3eecccdb5cf78ff21bca069c">fatal</a>()) &lt;&lt; <span class="stringliteral">&quot;Vault is missing for Broker &quot;</span> &lt;&lt; brokerID;</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#a48cab8527194fbd1cfdacad90f977cf1a57944bb500dddfef89ee6543a1408305">tefBAD_LEDGER</a>;</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> <span class="comment">// LCOV_EXCL_STOP</span></div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> }</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> </div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> <span class="keyword">auto</span> <span class="keyword">const</span> vaultAsset = vault-&gt;at(sfAsset);</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> </div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> <span class="keywordflow">if</span> (vaultAsset.native())</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> {</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> JLOG(ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#ae01ea816e51566ca4c097b8e95a81070">j</a>.<a class="code hl_function" href="classbeast_1_1Journal.html#ad8fefe3e8ad583e1ed1bf02094ac3d8f">warn</a>()) &lt;&lt; <span class="stringliteral">&quot;Cannot clawback native asset.&quot;</span>;</div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556bae97a00fb2d2ce5610fcc7cb1ce1e8155">tecNO_PERMISSION</a>;</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> }</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> </div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> <span class="comment">// Only the issuer of the vault asset can claw it back from the broker&#39;s</span></div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> <span class="comment">// cover funds.</span></div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> <span class="keywordflow">if</span> (vaultAsset.getIssuer() != account)</div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> {</div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> JLOG(ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#ae01ea816e51566ca4c097b8e95a81070">j</a>.<a class="code hl_function" href="classbeast_1_1Journal.html#ad8fefe3e8ad583e1ed1bf02094ac3d8f">warn</a>()) &lt;&lt; <span class="stringliteral">&quot;Account is not the issuer of the vault asset.&quot;</span>;</div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556bae97a00fb2d2ce5610fcc7cb1ce1e8155">tecNO_PERMISSION</a>;</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> }</div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> </div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> <span class="keywordflow">if</span> (amount)</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> {</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> <span class="keyword">auto</span> <span class="keyword">const</span> findAsset = <a class="code hl_function" href="namespacexrpl.html#afb78c3ff6c70477641d17524607a5dce">determineAsset</a>(ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#a4beaff9e60360494328296c6e4367a1c">view</a>, account, brokerPseudoAccountID, *amount);</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> <span class="keywordflow">if</span> (!findAsset)</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> <span class="keywordflow">return</span> findAsset.error();</div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> <span class="keyword">auto</span> <span class="keyword">const</span> txAsset = *findAsset;</div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> <span class="keywordflow">if</span> (txAsset != vaultAsset)</div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> {</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> JLOG(ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#ae01ea816e51566ca4c097b8e95a81070">j</a>.<a class="code hl_function" href="classbeast_1_1Journal.html#ad8fefe3e8ad583e1ed1bf02094ac3d8f">warn</a>()) &lt;&lt; <span class="stringliteral">&quot;Account is the correct issuer, but trying &quot;</span></div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> <span class="stringliteral">&quot;to clawback the wrong asset from LoanBroker&quot;</span>;</div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba1957d1d9fc2b8195c8717cd9b85ce5e3">tecWRONG_ASSET</a>;</div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> }</div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> }</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> </div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span> <span class="keyword">auto</span> <span class="keyword">const</span> findClawAmount = <a class="code hl_function" href="namespacexrpl.html#aabcbb0bfb4cf835b208547c7d281727a">determineClawAmount</a>(*sleBroker, vaultAsset, amount);</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span> <span class="keywordflow">if</span> (!findClawAmount)</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> {</div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> JLOG(ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#ae01ea816e51566ca4c097b8e95a81070">j</a>.<a class="code hl_function" href="classbeast_1_1Journal.html#ad8fefe3e8ad583e1ed1bf02094ac3d8f">warn</a>()) &lt;&lt; <span class="stringliteral">&quot;LoanBroker cover is already at minimum.&quot;</span>;</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> <span class="keywordflow">return</span> findClawAmount.error();</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> }</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> <a class="code hl_class" href="classxrpl_1_1STAmount.html">STAmount</a> <span class="keyword">const</span>&amp; clawAmount = *findClawAmount;</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> </div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> <span class="comment">// Explicitly check the balance of the trust line / MPT to make sure the</span></div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> <span class="comment">// balance is actually there. It should always match `sfCoverAvailable`, so</span></div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span> <span class="comment">// if there isn&#39;t, this is an internal error.</span></div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="namespacexrpl.html#a4f5cf1d4503b195f0d8640b978e13edf">accountHolds</a>(ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#a4beaff9e60360494328296c6e4367a1c">view</a>, brokerPseudoAccountID, vaultAsset, <a class="code hl_enumvalue" href="namespacexrpl.html#a1751722455e1d7c781d2cc897403a534aeb491d70a36a5ebbcce26afb3d50c868">fhIGNORE_FREEZE</a>, <a class="code hl_enumvalue" href="namespacexrpl.html#a97a9ff10fdce86ac84f6be6e23007dd4a859a6043078585553a3cf93854f29eaa">ahIGNORE_AUTH</a>, ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#ae01ea816e51566ca4c097b8e95a81070">j</a>) &lt; clawAmount)</div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"> 265</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba6869daf531ae5878c65a5095f103ce62">tecINTERNAL</a>; <span class="comment">// tecINSUFFICIENT_FUNDS; LCOV_EXCL_LINE</span></div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span> </div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span> <span class="comment">// Check if the vault asset issuer has the correct flags</span></div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> <span class="keyword">auto</span> <span class="keyword">const</span> sleIssuer = ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#a4beaff9e60360494328296c6e4367a1c">view</a>.<a class="code hl_function" href="classxrpl_1_1ReadView.html#ae7286da5df8ee36f950cc43fd3a46806">read</a>(<a class="code hl_function" href="namespacexrpl_1_1keylet.html#ac5d7a88f7cef6ac1ddf06020da8ded16">keylet::account</a>(vaultAsset.getIssuer()));</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> <span class="keywordflow">if</span> (!sleIssuer)</div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> {</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> <span class="comment">// LCOV_EXCL_START</span></div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> JLOG(ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#ae01ea816e51566ca4c097b8e95a81070">j</a>.<a class="code hl_function" href="classbeast_1_1Journal.html#a3dfb8e2e3eecccdb5cf78ff21bca069c">fatal</a>()) &lt;&lt; <span class="stringliteral">&quot;Issuer account does not exist.&quot;</span>;</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#a48cab8527194fbd1cfdacad90f977cf1a57944bb500dddfef89ee6543a1408305">tefBAD_LEDGER</a>;</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> <span class="comment">// LCOV_EXCL_STOP</span></div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> }</div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> </div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" href="http://en.cppreference.com/w/cpp/utility/variant/visit.html">std::visit</a>(</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> [&amp;]&lt;<span class="keyword">typename</span> T&gt;(T <span class="keyword">const</span>&amp;) { <span class="keywordflow">return</span> preclaimHelper&lt;T&gt;(ctx, *sleIssuer, clawAmount); }, vaultAsset.value());</div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span>}</div>
</div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> </div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span><a class="code hl_class" href="classxrpl_1_1TERSubset.html">TER</a></div>
<div class="foldopen" id="foldopen00282" data-start="{" data-end="}">
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"><a class="line" href="classxrpl_1_1LoanBrokerCoverClawback.html#a6da196fbc87ec06fb476e13a04f8b4c6"> 282</a></span><a class="code hl_function" href="classxrpl_1_1LoanBrokerCoverClawback.html#a6da196fbc87ec06fb476e13a04f8b4c6">LoanBrokerCoverClawback::doApply</a>()</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span>{</div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"> 284</span> <span class="keyword">auto</span> <span class="keyword">const</span>&amp; tx = <a class="code hl_variable" href="classxrpl_1_1Transactor.html#ac8b61136d9ebc92db493cd79f0f0f0b5">ctx_</a>.<a class="code hl_variable" href="classxrpl_1_1ApplyContext.html#a12176434ecde09cea7688f6bdf95c17f">tx</a>;</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span> <span class="keyword">auto</span> <span class="keyword">const</span> account = tx[sfAccount];</div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span> <span class="keyword">auto</span> <span class="keyword">const</span> findBrokerID = <a class="code hl_function" href="namespacexrpl.html#aa7503a308a843d7cb3f9850a82cfe908">determineBrokerID</a>(<a class="code hl_function" href="classxrpl_1_1Transactor.html#a9d90f09b3f9c786a878f206bd10e2890">view</a>(), tx);</div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"> 287</span> <span class="keywordflow">if</span> (!findBrokerID)</div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"> 288</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba6869daf531ae5878c65a5095f103ce62">tecINTERNAL</a>; <span class="comment">// LCOV_EXCL_LINE</span></div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> <span class="keyword">auto</span> <span class="keyword">const</span> brokerID = *findBrokerID;</div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> <span class="keyword">auto</span> <span class="keyword">const</span> amount = tx[~sfAmount];</div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span> </div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span> <span class="keyword">auto</span> sleBroker = <a class="code hl_function" href="classxrpl_1_1Transactor.html#a9d90f09b3f9c786a878f206bd10e2890">view</a>().<a class="code hl_function" href="classxrpl_1_1ApplyView.html#ae08e50d8506bc2beafd62ade8087285a">peek</a>(<a class="code hl_function" href="namespacexrpl_1_1keylet.html#a5a4a8623c7e5f6f866110316a6b286d4">keylet::loanbroker</a>(brokerID));</div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span> <span class="keywordflow">if</span> (!sleBroker)</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba6869daf531ae5878c65a5095f103ce62">tecINTERNAL</a>; <span class="comment">// LCOV_EXCL_LINE</span></div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span> </div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span> <span class="keyword">auto</span> <span class="keyword">const</span> brokerPseudoID = *sleBroker-&gt;at(sfAccount);</div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span> </div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span> <span class="keyword">auto</span> <span class="keyword">const</span> vault = <a class="code hl_function" href="classxrpl_1_1Transactor.html#a9d90f09b3f9c786a878f206bd10e2890">view</a>().<a class="code hl_function" href="classxrpl_1_1ReadView.html#ae7286da5df8ee36f950cc43fd3a46806">read</a>(<a class="code hl_function" href="namespacexrpl_1_1keylet.html#a9a7028770e8d9d38ca198d2096149766">keylet::vault</a>(sleBroker-&gt;at(sfVaultID)));</div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span> <span class="keywordflow">if</span> (!vault)</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba6869daf531ae5878c65a5095f103ce62">tecINTERNAL</a>; <span class="comment">// LCOV_EXCL_LINE</span></div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"> 301</span> </div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"> 302</span> <span class="keyword">auto</span> <span class="keyword">const</span> vaultAsset = vault-&gt;at(sfAsset);</div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span> </div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span> <span class="keyword">auto</span> <span class="keyword">const</span> findClawAmount = <a class="code hl_function" href="namespacexrpl.html#aabcbb0bfb4cf835b208547c7d281727a">determineClawAmount</a>(*sleBroker, vaultAsset, amount);</div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span> <span class="keywordflow">if</span> (!findClawAmount)</div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba6869daf531ae5878c65a5095f103ce62">tecINTERNAL</a>; <span class="comment">// LCOV_EXCL_LINE</span></div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"> 307</span> <a class="code hl_class" href="classxrpl_1_1STAmount.html">STAmount</a> <span class="keyword">const</span>&amp; clawAmount = *findClawAmount;</div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span> <span class="comment">// Just for paranoia&#39;s sake</span></div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"> 309</span> <span class="keywordflow">if</span> (clawAmount.<a class="code hl_function" href="classxrpl_1_1STAmount.html#aaf8652bbe699ee2b656e6e7f4dea28d1">native</a>())</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba6869daf531ae5878c65a5095f103ce62">tecINTERNAL</a>; <span class="comment">// LCOV_EXCL_LINE</span></div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span> </div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span> <span class="comment">// Decrease the LoanBroker&#39;s CoverAvailable by Amount</span></div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"> 313</span> sleBroker-&gt;at(sfCoverAvailable) -= clawAmount;</div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span> <a class="code hl_function" href="classxrpl_1_1Transactor.html#a9d90f09b3f9c786a878f206bd10e2890">view</a>().<a class="code hl_function" href="classxrpl_1_1ApplyView.html#a1c494e32b7dfe50416045d749ba4f560">update</a>(sleBroker);</div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> </div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"> 316</span> <a class="code hl_function" href="namespacexrpl.html#adf6a712b96f28b3109e43464dc2e22d7">associateAsset</a>(*sleBroker, vaultAsset);</div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"> 317</span> </div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno"> 318</span> <span class="comment">// Transfer assets from pseudo-account to depositor.</span></div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"> 319</span> <span class="keywordflow">return</span> <a class="code hl_function" href="namespacexrpl.html#a7d1fa732064ef22175aac4d8de440e6d">accountSend</a>(<a class="code hl_function" href="classxrpl_1_1Transactor.html#a9d90f09b3f9c786a878f206bd10e2890">view</a>(), brokerPseudoID, account, clawAmount, <a class="code hl_variable" href="classxrpl_1_1Transactor.html#a70d80b15016025468966dddb23ab0e8d">j_</a>, <a class="code hl_enumvalue" href="namespacexrpl.html#a53be00cb856ef39ec60e33cf9694b5eba93cba07454f06a4a960172bbd6e2a435">WaiveTransferFee::Yes</a>);</div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span>}</div>
</div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span> </div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span><span class="comment">//------------------------------------------------------------------------------</span></div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno"> 323</span> </div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno"> 324</span>} <span class="comment">// namespace xrpl</span></div>
<div class="ttc" id="aclassbeast_1_1Journal_html_a3dfb8e2e3eecccdb5cf78ff21bca069c"><div class="ttname"><a href="classbeast_1_1Journal.html#a3dfb8e2e3eecccdb5cf78ff21bca069c">beast::Journal::fatal</a></div><div class="ttdeci">Stream fatal() const</div><div class="ttdef"><b>Definition</b> <a href="Journal_8h_source.html#l00325">Journal.h:325</a></div></div>
<div class="ttc" id="aclassbeast_1_1Journal_html_ad8fefe3e8ad583e1ed1bf02094ac3d8f"><div class="ttname"><a href="classbeast_1_1Journal.html#ad8fefe3e8ad583e1ed1bf02094ac3d8f">beast::Journal::warn</a></div><div class="ttdeci">Stream warn() const</div><div class="ttdef"><b>Definition</b> <a href="Journal_8h_source.html#l00313">Journal.h:313</a></div></div>
<div class="ttc" id="aclassxrpl_1_1ApplyContext_html_a12176434ecde09cea7688f6bdf95c17f"><div class="ttname"><a href="classxrpl_1_1ApplyContext.html#a12176434ecde09cea7688f6bdf95c17f">xrpl::ApplyContext::tx</a></div><div class="ttdeci">STTx const &amp; tx</div><div class="ttdef"><b>Definition</b> <a href="ApplyContext_8h_source.html#l00044">ApplyContext.h:44</a></div></div>
<div class="ttc" id="aclassxrpl_1_1ApplyView_html_a1c494e32b7dfe50416045d749ba4f560"><div class="ttname"><a href="classxrpl_1_1ApplyView.html#a1c494e32b7dfe50416045d749ba4f560">xrpl::ApplyView::update</a></div><div class="ttdeci">virtual void update(std::shared_ptr&lt; SLE &gt; const &amp;sle)=0</div><div class="ttdoc">Indicate changes to a peeked SLE.</div></div>
<div class="ttc" id="aclassxrpl_1_1ApplyView_html_ae08e50d8506bc2beafd62ade8087285a"><div class="ttname"><a href="classxrpl_1_1ApplyView.html#ae08e50d8506bc2beafd62ade8087285a">xrpl::ApplyView::peek</a></div><div class="ttdeci">virtual std::shared_ptr&lt; SLE &gt; peek(Keylet const &amp;k)=0</div><div class="ttdoc">Prepare to modify the SLE associated with key.</div></div>
<div class="ttc" id="aclassxrpl_1_1Asset_html"><div class="ttname"><a href="classxrpl_1_1Asset.html">xrpl::Asset</a></div><div class="ttdef"><b>Definition</b> <a href="Asset_8h_source.html#l00026">Asset.h:27</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Expected_html"><div class="ttname"><a href="classxrpl_1_1Expected.html">xrpl::Expected</a></div><div class="ttdef"><b>Definition</b> <a href="Expected_8h_source.html#l00111">Expected.h:112</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Issue_html"><div class="ttname"><a href="classxrpl_1_1Issue.html">xrpl::Issue</a></div><div class="ttdoc">A currency issued by an account.</div><div class="ttdef"><b>Definition</b> <a href="Issue_8h_source.html#l00013">Issue.h:14</a></div></div>
<div class="ttc" id="aclassxrpl_1_1LoanBrokerCoverClawback_html_a61399b05b900aeb1ad2ca4ef932d3783"><div class="ttname"><a href="classxrpl_1_1LoanBrokerCoverClawback.html#a61399b05b900aeb1ad2ca4ef932d3783">xrpl::LoanBrokerCoverClawback::preclaim</a></div><div class="ttdeci">static TER preclaim(PreclaimContext const &amp;ctx)</div><div class="ttdef"><b>Definition</b> <a href="LoanBrokerCoverClawback_8cpp_source.html#l00194">LoanBrokerCoverClawback.cpp:194</a></div></div>
<div class="ttc" id="aclassxrpl_1_1LoanBrokerCoverClawback_html_a6da196fbc87ec06fb476e13a04f8b4c6"><div class="ttname"><a href="classxrpl_1_1LoanBrokerCoverClawback.html#a6da196fbc87ec06fb476e13a04f8b4c6">xrpl::LoanBrokerCoverClawback::doApply</a></div><div class="ttdeci">TER doApply() override</div><div class="ttdef"><b>Definition</b> <a href="LoanBrokerCoverClawback_8cpp_source.html#l00282">LoanBrokerCoverClawback.cpp:282</a></div></div>
<div class="ttc" id="aclassxrpl_1_1LoanBrokerCoverClawback_html_a812e7b6e404837cd88e7792236f64abd"><div class="ttname"><a href="classxrpl_1_1LoanBrokerCoverClawback.html#a812e7b6e404837cd88e7792236f64abd">xrpl::LoanBrokerCoverClawback::preflight</a></div><div class="ttdeci">static NotTEC preflight(PreflightContext const &amp;ctx)</div><div class="ttdef"><b>Definition</b> <a href="LoanBrokerCoverClawback_8cpp_source.html#l00016">LoanBrokerCoverClawback.cpp:16</a></div></div>
<div class="ttc" id="aclassxrpl_1_1LoanBrokerCoverClawback_html_aec06bdf9c63ec8e27222a7afd0ac36a4"><div class="ttname"><a href="classxrpl_1_1LoanBrokerCoverClawback.html#aec06bdf9c63ec8e27222a7afd0ac36a4">xrpl::LoanBrokerCoverClawback::checkExtraFeatures</a></div><div class="ttdeci">static bool checkExtraFeatures(PreflightContext const &amp;ctx)</div><div class="ttdef"><b>Definition</b> <a href="LoanBrokerCoverClawback_8cpp_source.html#l00010">LoanBrokerCoverClawback.cpp:10</a></div></div>
<div class="ttc" id="aclassxrpl_1_1MPTIssue_html"><div class="ttname"><a href="classxrpl_1_1MPTIssue.html">xrpl::MPTIssue</a></div><div class="ttdef"><b>Definition</b> <a href="MPTIssue_8h_source.html#l00013">MPTIssue.h:14</a></div></div>
<div class="ttc" id="aclassxrpl_1_1MPTIssue_html_a5a2ee1ae0ff364ab92677034c3bc09c3"><div class="ttname"><a href="classxrpl_1_1MPTIssue.html#a5a2ee1ae0ff364ab92677034c3bc09c3">xrpl::MPTIssue::getMptID</a></div><div class="ttdeci">constexpr MPTID const &amp; getMptID() const</div><div class="ttdef"><b>Definition</b> <a href="MPTIssue_8h_source.html#l00027">MPTIssue.h:27</a></div></div>
<div class="ttc" id="aclassxrpl_1_1NumberRoundModeGuard_html"><div class="ttname"><a href="classxrpl_1_1NumberRoundModeGuard.html">xrpl::NumberRoundModeGuard</a></div><div class="ttdef"><b>Definition</b> <a href="Number_8h_source.html#l00780">Number.h:781</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Number_html"><div class="ttname"><a href="classxrpl_1_1Number.html">xrpl::Number</a></div><div class="ttdoc">Number is a floating point type that can represent a wide range of values.</div><div class="ttdef"><b>Definition</b> <a href="Number_8h_source.html#l00207">Number.h:208</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Number_html_a40e08f75077897215c66d102b5b75f95aaf71effcd4dcf7bc7c89bb51e27e8b17"><div class="ttname"><a href="classxrpl_1_1Number.html#a40e08f75077897215c66d102b5b75f95aaf71effcd4dcf7bc7c89bb51e27e8b17">xrpl::Number::upward</a></div><div class="ttdeci">@ upward</div><div class="ttdef"><b>Definition</b> <a href="Number_8h_source.html#l00381">Number.h:381</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Number_html_a40e08f75077897215c66d102b5b75f95aefac6c5bd63a85dcee4fc69baf788d40"><div class="ttname"><a href="classxrpl_1_1Number.html#a40e08f75077897215c66d102b5b75f95aefac6c5bd63a85dcee4fc69baf788d40">xrpl::Number::downward</a></div><div class="ttdeci">@ downward</div><div class="ttdef"><b>Definition</b> <a href="Number_8h_source.html#l00381">Number.h:381</a></div></div>
<div class="ttc" id="aclassxrpl_1_1ReadView_html"><div class="ttname"><a href="classxrpl_1_1ReadView.html">xrpl::ReadView</a></div><div class="ttdoc">A view into a ledger.</div><div class="ttdef"><b>Definition</b> <a href="ReadView_8h_source.html#l00031">ReadView.h:32</a></div></div>
<div class="ttc" id="aclassxrpl_1_1ReadView_html_ae7286da5df8ee36f950cc43fd3a46806"><div class="ttname"><a href="classxrpl_1_1ReadView.html#ae7286da5df8ee36f950cc43fd3a46806">xrpl::ReadView::read</a></div><div class="ttdeci">virtual std::shared_ptr&lt; SLE const &gt; read(Keylet const &amp;k) const =0</div><div class="ttdoc">Return the state item associated with a key.</div></div>
<div class="ttc" id="aclassxrpl_1_1STAmount_html"><div class="ttname"><a href="classxrpl_1_1STAmount.html">xrpl::STAmount</a></div><div class="ttdef"><b>Definition</b> <a href="STAmount_8h_source.html#l00030">STAmount.h:31</a></div></div>
<div class="ttc" id="aclassxrpl_1_1STAmount_html_a118c2d691f9fe2ab1b9c19441d088c0d"><div class="ttname"><a href="classxrpl_1_1STAmount.html#a118c2d691f9fe2ab1b9c19441d088c0d">xrpl::STAmount::get</a></div><div class="ttdeci">constexpr TIss const &amp; get() const</div></div>
<div class="ttc" id="aclassxrpl_1_1STAmount_html_aaf8652bbe699ee2b656e6e7f4dea28d1"><div class="ttname"><a href="classxrpl_1_1STAmount.html#aaf8652bbe699ee2b656e6e7f4dea28d1">xrpl::STAmount::native</a></div><div class="ttdeci">bool native() const noexcept</div><div class="ttdef"><b>Definition</b> <a href="STAmount_8h_source.html#l00417">STAmount.h:417</a></div></div>
<div class="ttc" id="aclassxrpl_1_1STLedgerEntry_html"><div class="ttname"><a href="classxrpl_1_1STLedgerEntry.html">xrpl::STLedgerEntry</a></div><div class="ttdef"><b>Definition</b> <a href="STLedgerEntry_8h_source.html#l00014">STLedgerEntry.h:15</a></div></div>
<div class="ttc" id="aclassxrpl_1_1STObject_html_a7c26c5171818777d2ec200dbffc317c5"><div class="ttname"><a href="classxrpl_1_1STObject.html#a7c26c5171818777d2ec200dbffc317c5">xrpl::STObject::isFlag</a></div><div class="ttdeci">bool isFlag(std::uint32_t) const</div><div class="ttdef"><b>Definition</b> <a href="STObject_8cpp_source.html#l00486">STObject.cpp:486</a></div></div>
<div class="ttc" id="aclassxrpl_1_1STTx_html"><div class="ttname"><a href="classxrpl_1_1STTx.html">xrpl::STTx</a></div><div class="ttdef"><b>Definition</b> <a href="STTx_8h_source.html#l00028">STTx.h:29</a></div></div>
<div class="ttc" id="aclassxrpl_1_1TERSubset_html"><div class="ttname"><a href="classxrpl_1_1TERSubset.html">xrpl::TERSubset</a></div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00395">TER.h:396</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Transactor_html_a70d80b15016025468966dddb23ab0e8d"><div class="ttname"><a href="classxrpl_1_1Transactor.html#a70d80b15016025468966dddb23ab0e8d">xrpl::Transactor::j_</a></div><div class="ttdeci">beast::Journal const j_</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00111">Transactor.h:111</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Transactor_html_a9d90f09b3f9c786a878f206bd10e2890"><div class="ttname"><a href="classxrpl_1_1Transactor.html#a9d90f09b3f9c786a878f206bd10e2890">xrpl::Transactor::view</a></div><div class="ttdeci">ApplyView &amp; view()</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00129">Transactor.h:129</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Transactor_html_ac8b61136d9ebc92db493cd79f0f0f0b5"><div class="ttname"><a href="classxrpl_1_1Transactor.html#ac8b61136d9ebc92db493cd79f0f0f0b5">xrpl::Transactor::ctx_</a></div><div class="ttdeci">ApplyContext &amp; ctx_</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00109">Transactor.h:109</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Unexpected_html"><div class="ttname"><a href="classxrpl_1_1Unexpected.html">xrpl::Unexpected</a></div><div class="ttdef"><b>Definition</b> <a href="Expected_8h_source.html#l00062">Expected.h:63</a></div></div>
<div class="ttc" id="aclassxrpl_1_1base__uint_html"><div class="ttname"><a href="classxrpl_1_1base__uint.html">xrpl::base_uint&lt; 160, detail::AccountIDTag &gt;</a></div></div>
<div class="ttc" id="anamespacexrpl_1_1keylet_html_a5a4a8623c7e5f6f866110316a6b286d4"><div class="ttname"><a href="namespacexrpl_1_1keylet.html#a5a4a8623c7e5f6f866110316a6b286d4">xrpl::keylet::loanbroker</a></div><div class="ttdeci">Keylet loanbroker(AccountID const &amp;owner, std::uint32_t seq) noexcept</div><div class="ttdef"><b>Definition</b> <a href="Indexes_8cpp_source.html#l00498">Indexes.cpp:498</a></div></div>
<div class="ttc" id="anamespacexrpl_1_1keylet_html_a77d91a4fd20b17d44ccb32b4e9ae2d9b"><div class="ttname"><a href="namespacexrpl_1_1keylet.html#a77d91a4fd20b17d44ccb32b4e9ae2d9b">xrpl::keylet::mptIssuance</a></div><div class="ttdeci">Keylet mptIssuance(std::uint32_t seq, AccountID const &amp;issuer) noexcept</div><div class="ttdef"><b>Definition</b> <a href="Indexes_8cpp_source.html#l00462">Indexes.cpp:462</a></div></div>
<div class="ttc" id="anamespacexrpl_1_1keylet_html_a9a7028770e8d9d38ca198d2096149766"><div class="ttname"><a href="namespacexrpl_1_1keylet.html#a9a7028770e8d9d38ca198d2096149766">xrpl::keylet::vault</a></div><div class="ttdeci">Keylet vault(AccountID const &amp;owner, std::uint32_t seq) noexcept</div><div class="ttdef"><b>Definition</b> <a href="Indexes_8cpp_source.html#l00492">Indexes.cpp:492</a></div></div>
<div class="ttc" id="anamespacexrpl_1_1keylet_html_ac5d7a88f7cef6ac1ddf06020da8ded16"><div class="ttname"><a href="namespacexrpl_1_1keylet.html#ac5d7a88f7cef6ac1ddf06020da8ded16">xrpl::keylet::account</a></div><div class="ttdeci">Keylet account(AccountID const &amp;id) noexcept</div><div class="ttdoc">AccountID root.</div><div class="ttdef"><b>Definition</b> <a href="Indexes_8cpp_source.html#l00160">Indexes.cpp:160</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="anamespacexrpl_html_a1751722455e1d7c781d2cc897403a534aeb491d70a36a5ebbcce26afb3d50c868"><div class="ttname"><a href="namespacexrpl.html#a1751722455e1d7c781d2cc897403a534aeb491d70a36a5ebbcce26afb3d50c868">xrpl::fhIGNORE_FREEZE</a></div><div class="ttdeci">@ fhIGNORE_FREEZE</div><div class="ttdef"><b>Definition</b> <a href="View_8h_source.html#l00059">View.h:59</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a3f56d997a36633a10ca0f17c86113f56"><div class="ttname"><a href="namespacexrpl.html#a3f56d997a36633a10ca0f17c86113f56">xrpl::tenthBipsOfValue</a></div><div class="ttdeci">constexpr T tenthBipsOfValue(T value, TenthBips&lt; TBips &gt; bips)</div><div class="ttdef"><b>Definition</b> <a href="Protocol_8h_source.html#l00108">Protocol.h:108</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a48cab8527194fbd1cfdacad90f977cf1a57944bb500dddfef89ee6543a1408305"><div class="ttname"><a href="namespacexrpl.html#a48cab8527194fbd1cfdacad90f977cf1a57944bb500dddfef89ee6543a1408305">xrpl::tefBAD_LEDGER</a></div><div class="ttdeci">@ tefBAD_LEDGER</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00151">TER.h:151</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a4b4f85373c903b06cac8795afc79820e"><div class="ttname"><a href="namespacexrpl.html#a4b4f85373c903b06cac8795afc79820e">xrpl::isLegalNet</a></div><div class="ttdeci">bool isLegalNet(STAmount const &amp;value)</div><div class="ttdef"><b>Definition</b> <a href="STAmount_8h_source.html#l00567">STAmount.h:567</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a4c0d6c5117eb6c71f933532d1a216f7b"><div class="ttname"><a href="namespacexrpl.html#a4c0d6c5117eb6c71f933532d1a216f7b">xrpl::checkLendingProtocolDependencies</a></div><div class="ttdeci">bool checkLendingProtocolDependencies(PreflightContext const &amp;ctx)</div><div class="ttdef"><b>Definition</b> <a href="LendingHelpers_8cpp_source.html#l00008">LendingHelpers.cpp:8</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a4f5cf1d4503b195f0d8640b978e13edf"><div class="ttname"><a href="namespacexrpl.html#a4f5cf1d4503b195f0d8640b978e13edf">xrpl::accountHolds</a></div><div class="ttdeci">STAmount accountHolds(ReadView const &amp;view, AccountID const &amp;account, Currency const &amp;currency, AccountID const &amp;issuer, FreezeHandling zeroIfFrozen, beast::Journal j, SpendableHandling includeFullBalance=shSIMPLE_BALANCE)</div><div class="ttdef"><b>Definition</b> <a href="View_8cpp_source.html#l00392">View.cpp:392</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a53be00cb856ef39ec60e33cf9694b5eba93cba07454f06a4a960172bbd6e2a435"><div class="ttname"><a href="namespacexrpl.html#a53be00cb856ef39ec60e33cf9694b5eba93cba07454f06a4a960172bbd6e2a435">xrpl::WaiveTransferFee::Yes</a></div><div class="ttdeci">@ Yes</div></div>
<div class="ttc" id="anamespacexrpl_html_a64347051276d9ee7646d93623f5039b4"><div class="ttname"><a href="namespacexrpl.html#a64347051276d9ee7646d93623f5039b4">xrpl::TenthBips32</a></div><div class="ttdeci">TenthBips&lt; std::uint32_t &gt; TenthBips32</div><div class="ttdef"><b>Definition</b> <a href="Units_8h_source.html#l00430">Units.h:430</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a7c08c383d2c90b3825d1dd62b70443d4"><div class="ttname"><a href="namespacexrpl.html#a7c08c383d2c90b3825d1dd62b70443d4">xrpl::preclaimHelper</a></div><div class="ttdeci">static TER preclaimHelper(PreclaimContext const &amp;ctx, SLE const &amp;sleIssuer, AccountID const &amp;issuer, AccountID const &amp;holder, STAmount const &amp;clawAmount)</div></div>
<div class="ttc" id="anamespacexrpl_html_a7d1fa732064ef22175aac4d8de440e6d"><div class="ttname"><a href="namespacexrpl.html#a7d1fa732064ef22175aac4d8de440e6d">xrpl::accountSend</a></div><div class="ttdeci">TER accountSend(ApplyView &amp;view, AccountID const &amp;from, AccountID const &amp;to, STAmount const &amp;saAmount, beast::Journal j, WaiveTransferFee waiveFee=WaiveTransferFee::No)</div><div class="ttdoc">Calls static accountSendIOU if saAmount represents Issue.</div><div class="ttdef"><b>Definition</b> <a href="View_8cpp_source.html#l02446">View.cpp:2446</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a89ce254d202a943d2f5bad19d88787a5"><div class="ttname"><a href="namespacexrpl.html#a89ce254d202a943d2f5bad19d88787a5">xrpl::TER</a></div><div class="ttdeci">TERSubset&lt; CanCvtToTER &gt; TER</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00621">TER.h:621</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a9522b493208dabe4ca01ed631c702d33"><div class="ttname"><a href="namespacexrpl.html#a9522b493208dabe4ca01ed631c702d33">xrpl::preclaimHelper&lt; Issue &gt;</a></div><div class="ttdeci">TER preclaimHelper&lt; Issue &gt;(PreclaimContext const &amp;ctx, SLE const &amp;sleIssuer, AccountID const &amp;issuer, AccountID const &amp;holder, STAmount const &amp;clawAmount)</div><div class="ttdef"><b>Definition</b> <a href="Clawback_8cpp_source.html#l00085">Clawback.cpp:86</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a97a9ff10fdce86ac84f6be6e23007dd4a859a6043078585553a3cf93854f29eaa"><div class="ttname"><a href="namespacexrpl.html#a97a9ff10fdce86ac84f6be6e23007dd4a859a6043078585553a3cf93854f29eaa">xrpl::ahIGNORE_AUTH</a></div><div class="ttdeci">@ ahIGNORE_AUTH</div><div class="ttdef"><b>Definition</b> <a href="View_8h_source.html#l00062">View.h:62</a></div></div>
<div class="ttc" id="anamespacexrpl_html_aa7503a308a843d7cb3f9850a82cfe908"><div class="ttname"><a href="namespacexrpl.html#aa7503a308a843d7cb3f9850a82cfe908">xrpl::determineBrokerID</a></div><div class="ttdeci">Expected&lt; uint256, TER &gt; determineBrokerID(ReadView const &amp;view, STTx const &amp;tx)</div><div class="ttdef"><b>Definition</b> <a href="LoanBrokerCoverClawback_8cpp_source.html#l00060">LoanBrokerCoverClawback.cpp:60</a></div></div>
<div class="ttc" id="anamespacexrpl_html_aabcbb0bfb4cf835b208547c7d281727a"><div class="ttname"><a href="namespacexrpl.html#aabcbb0bfb4cf835b208547c7d281727a">xrpl::determineClawAmount</a></div><div class="ttdeci">Expected&lt; STAmount, TER &gt; determineClawAmount(SLE const &amp;sleBroker, Asset const &amp;vaultAsset, std::optional&lt; STAmount &gt; const &amp;amount)</div><div class="ttdef"><b>Definition</b> <a href="LoanBrokerCoverClawback_8cpp_source.html#l00133">LoanBrokerCoverClawback.cpp:133</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ac8c50610643a4f902b9bb9e42d0b00e6a2d9e286ee2cc7d46dba7d5812daada61"><div class="ttname"><a href="namespacexrpl.html#ac8c50610643a4f902b9bb9e42d0b00e6a2d9e286ee2cc7d46dba7d5812daada61">xrpl::temINVALID</a></div><div class="ttdeci">@ temINVALID</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00091">TER.h:91</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ac8c50610643a4f902b9bb9e42d0b00e6aa9a4c76c9c7d2e1fc83581b9ce4d5152"><div class="ttname"><a href="namespacexrpl.html#ac8c50610643a4f902b9bb9e42d0b00e6aa9a4c76c9c7d2e1fc83581b9ce4d5152">xrpl::temBAD_AMOUNT</a></div><div class="ttdeci">@ temBAD_AMOUNT</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00070">TER.h:70</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ad78c115958eec639754bf9227f58556ba1957d1d9fc2b8195c8717cd9b85ce5e3"><div class="ttname"><a href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba1957d1d9fc2b8195c8717cd9b85ce5e3">xrpl::tecWRONG_ASSET</a></div><div class="ttdeci">@ tecWRONG_ASSET</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00342">TER.h:342</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ad78c115958eec639754bf9227f58556ba348afbc4922cc9b29af76316d5d8a277"><div class="ttname"><a href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba348afbc4922cc9b29af76316d5d8a277">xrpl::tecNO_ENTRY</a></div><div class="ttdeci">@ tecNO_ENTRY</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00288">TER.h:288</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ad78c115958eec639754bf9227f58556ba51bfb4a3d241d816dbbcb77147125f16"><div class="ttname"><a href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba51bfb4a3d241d816dbbcb77147125f16">xrpl::tecOBJECT_NOT_FOUND</a></div><div class="ttdeci">@ tecOBJECT_NOT_FOUND</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00308">TER.h:308</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ad78c115958eec639754bf9227f58556ba6869daf531ae5878c65a5095f103ce62"><div class="ttname"><a href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba6869daf531ae5878c65a5095f103ce62">xrpl::tecINTERNAL</a></div><div class="ttdeci">@ tecINTERNAL</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00292">TER.h:292</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ad78c115958eec639754bf9227f58556ba8479260fa4500bef887fa8e8c9f3c624"><div class="ttname"><a href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba8479260fa4500bef887fa8e8c9f3c624">xrpl::tecINSUFFICIENT_FUNDS</a></div><div class="ttdeci">@ tecINSUFFICIENT_FUNDS</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00307">TER.h:307</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ad78c115958eec639754bf9227f58556bae97a00fb2d2ce5610fcc7cb1ce1e8155"><div class="ttname"><a href="namespacexrpl.html#ad78c115958eec639754bf9227f58556bae97a00fb2d2ce5610fcc7cb1ce1e8155">xrpl::tecNO_PERMISSION</a></div><div class="ttdeci">@ tecNO_PERMISSION</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00287">TER.h:287</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ada4805619214865518ed8c0b54a71bc1a02052ddc688667765a5ca728bc2363f4"><div class="ttname"><a href="namespacexrpl.html#ada4805619214865518ed8c0b54a71bc1a02052ddc688667765a5ca728bc2363f4">xrpl::lsfAllowTrustLineClawback</a></div><div class="ttdeci">@ lsfAllowTrustLineClawback</div><div class="ttdef"><b>Definition</b> <a href="LedgerFormats_8h_source.html#l00132">LedgerFormats.h:131</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ada4805619214865518ed8c0b54a71bc1a2fa56ae026467d77bd73e2f5af7f3953"><div class="ttname"><a href="namespacexrpl.html#ada4805619214865518ed8c0b54a71bc1a2fa56ae026467d77bd73e2f5af7f3953">xrpl::lsfNoFreeze</a></div><div class="ttdeci">@ lsfNoFreeze</div><div class="ttdef"><b>Definition</b> <a href="LedgerFormats_8h_source.html#l00113">LedgerFormats.h:113</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ada4805619214865518ed8c0b54a71bc1ad6173188f5f849b70d84b480f5800145"><div class="ttname"><a href="namespacexrpl.html#ada4805619214865518ed8c0b54a71bc1ad6173188f5f849b70d84b480f5800145">xrpl::lsfMPTCanClawback</a></div><div class="ttdeci">@ lsfMPTCanClawback</div><div class="ttdef"><b>Definition</b> <a href="LedgerFormats_8h_source.html#l00170">LedgerFormats.h:170</a></div></div>
<div class="ttc" id="anamespacexrpl_html_adf6a712b96f28b3109e43464dc2e22d7"><div class="ttname"><a href="namespacexrpl.html#adf6a712b96f28b3109e43464dc2e22d7">xrpl::associateAsset</a></div><div class="ttdeci">void associateAsset(STLedgerEntry &amp;sle, Asset const &amp;asset)</div><div class="ttdoc">Associate an Asset with all sMD_NeedsAsset fields in a ledger entry.</div></div>
<div class="ttc" id="anamespacexrpl_html_aed538cdba0392ec46b599d33ea552501"><div class="ttname"><a href="namespacexrpl.html#aed538cdba0392ec46b599d33ea552501">xrpl::preclaimHelper&lt; MPTIssue &gt;</a></div><div class="ttdeci">TER preclaimHelper&lt; MPTIssue &gt;(PreclaimContext const &amp;ctx, SLE const &amp;sleIssuer, AccountID const &amp;issuer, AccountID const &amp;holder, STAmount const &amp;clawAmount)</div><div class="ttdef"><b>Definition</b> <a href="Clawback_8cpp_source.html#l00130">Clawback.cpp:131</a></div></div>
<div class="ttc" id="anamespacexrpl_html_af4adbbe94a1cecf1bd3ad2c76ff1ea3da157dace29a657c58cdeb4f7fa19be976"><div class="ttname"><a href="namespacexrpl.html#af4adbbe94a1cecf1bd3ad2c76ff1ea3da157dace29a657c58cdeb4f7fa19be976">xrpl::tesSUCCESS</a></div><div class="ttdeci">@ tesSUCCESS</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00227">TER.h:226</a></div></div>
<div class="ttc" id="anamespacexrpl_html_afb78c3ff6c70477641d17524607a5dce"><div class="ttname"><a href="namespacexrpl.html#afb78c3ff6c70477641d17524607a5dce">xrpl::determineAsset</a></div><div class="ttdeci">Expected&lt; Asset, TER &gt; determineAsset(ReadView const &amp;view, AccountID const &amp;account, AccountID const &amp;brokerPseudoAccountID, STAmount const &amp;amount)</div><div class="ttdef"><b>Definition</b> <a href="LoanBrokerCoverClawback_8cpp_source.html#l00103">LoanBrokerCoverClawback.cpp:103</a></div></div>
<div class="ttc" id="aoptional_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional</a></div></div>
<div class="ttc" id="astructxrpl_1_1PreclaimContext_html"><div class="ttname"><a href="structxrpl_1_1PreclaimContext.html">xrpl::PreclaimContext</a></div><div class="ttdoc">State information when determining if a tx is likely to claim a fee.</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00053">Transactor.h:54</a></div></div>
<div class="ttc" id="astructxrpl_1_1PreclaimContext_html_a4beaff9e60360494328296c6e4367a1c"><div class="ttname"><a href="structxrpl_1_1PreclaimContext.html#a4beaff9e60360494328296c6e4367a1c">xrpl::PreclaimContext::view</a></div><div class="ttdeci">ReadView const &amp; view</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00057">Transactor.h:57</a></div></div>
<div class="ttc" id="astructxrpl_1_1PreclaimContext_html_add7a860523e30f2b1caf7da6fa23ce39"><div class="ttname"><a href="structxrpl_1_1PreclaimContext.html#add7a860523e30f2b1caf7da6fa23ce39">xrpl::PreclaimContext::tx</a></div><div class="ttdeci">STTx const &amp; tx</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00060">Transactor.h:60</a></div></div>
<div class="ttc" id="astructxrpl_1_1PreclaimContext_html_ae01ea816e51566ca4c097b8e95a81070"><div class="ttname"><a href="structxrpl_1_1PreclaimContext.html#ae01ea816e51566ca4c097b8e95a81070">xrpl::PreclaimContext::j</a></div><div class="ttdeci">beast::Journal const j</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00062">Transactor.h:62</a></div></div>
<div class="ttc" id="astructxrpl_1_1PreflightContext_html"><div class="ttname"><a href="structxrpl_1_1PreflightContext.html">xrpl::PreflightContext</a></div><div class="ttdoc">State information when preflighting a tx.</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00015">Transactor.h:16</a></div></div>
<div class="ttc" id="astructxrpl_1_1PreflightContext_html_ad1cfd2197bb28468799d62785e974952"><div class="ttname"><a href="structxrpl_1_1PreflightContext.html#ad1cfd2197bb28468799d62785e974952">xrpl::PreflightContext::tx</a></div><div class="ttdeci">STTx const &amp; tx</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00019">Transactor.h:19</a></div></div>
<div class="ttc" id="avisit_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/variant/visit.html">std::visit</a></div><div class="ttdeci">T visit(T... args)</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>