mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-30 07:55:51 +00:00
deploy: 78076a6903
This commit is contained in:
@@ -105,227 +105,225 @@ $(function() {
|
||||
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  </div>
|
||||
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="comment">// {</span></div>
|
||||
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment">// account: <ident>,</span></div>
|
||||
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment">// strict: <bool> // optional (default false)</span></div>
|
||||
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment">// // if true only allow public keys and addresses.</span></div>
|
||||
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment">// ledger_hash : <ledger></span></div>
|
||||
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="comment">// ledger_index : <ledger_index></span></div>
|
||||
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="comment">// signer_lists : <bool> // optional (default false)</span></div>
|
||||
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="comment">// // if true return SignerList(s).</span></div>
|
||||
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="comment">// queue : <bool> // optional (default false)</span></div>
|
||||
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="comment">// // if true return information about transactions</span></div>
|
||||
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="comment">// // in the current TxQ, only if the requested</span></div>
|
||||
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="comment">// // ledger is open. Otherwise if true, returns an</span></div>
|
||||
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="comment">// // error.</span></div>
|
||||
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="comment">// }</span></div>
|
||||
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  </div>
|
||||
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="comment">// TODO(tom): what is that "default"?</span></div>
|
||||
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <a class="code" href="classJson_1_1Value.html">Json::Value</a></div>
|
||||
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="namespaceripple.html#ad3181666a917aca45f4f288e690e9305"> 52</a></span> <a class="code" href="namespaceripple.html#ad3181666a917aca45f4f288e690e9305">doAccountInfo</a>(<a class="code" href="structripple_1_1RPC_1_1JsonContext.html">RPC::JsonContext</a>& context)</div>
|
||||
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> {</div>
|
||||
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="keyword">auto</span>& params = context.<a class="code" href="structripple_1_1RPC_1_1JsonContext.html#a036b2c14552fbca49011c3d0e78017fa">params</a>;</div>
|
||||
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  </div>
|
||||
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> strIdent;</div>
|
||||
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <span class="keywordflow">if</span> (params.isMember(jss::account))</div>
|
||||
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  strIdent = params[jss::account].asString();</div>
|
||||
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (params.isMember(jss::ident))</div>
|
||||
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  strIdent = params[jss::ident].asString();</div>
|
||||
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <span class="keywordflow">return</span> <a class="code" href="namespaceripple_1_1RPC.html#aec2e1163b39a450d3917af9dd15b0f06">RPC::missing_field_error</a>(jss::account);</div>
|
||||
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  </div>
|
||||
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr<ReadView const></a> ledger;</div>
|
||||
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="keyword">auto</span> result = <a class="code" href="namespaceripple_1_1RPC.html#aaebfaaee35308269fab499f4e203a8c9">RPC::lookupLedger</a>(ledger, context);</div>
|
||||
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  </div>
|
||||
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="keywordflow">if</span> (!ledger)</div>
|
||||
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <span class="keywordflow">return</span> result;</div>
|
||||
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  </div>
|
||||
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="keywordtype">bool</span> bStrict = params.isMember(jss::strict) && params[jss::strict].asBool();</div>
|
||||
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <a class="code" href="classripple_1_1base__uint.html">AccountID</a> accountID;</div>
|
||||
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  </div>
|
||||
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="comment">// Get info on account.</span></div>
|
||||
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  </div>
|
||||
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="keyword">auto</span> jvAccepted = <a class="code" href="namespaceripple_1_1RPC.html#a9dc259937a004b30e88f41a95756bee0">RPC::accountFromString</a>(accountID, strIdent, bStrict);</div>
|
||||
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment">// ledger_hash : <ledger></span></div>
|
||||
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment">// ledger_index : <ledger_index></span></div>
|
||||
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment">// signer_lists : <bool> // optional (default false)</span></div>
|
||||
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="comment">// // if true return SignerList(s).</span></div>
|
||||
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="comment">// queue : <bool> // optional (default false)</span></div>
|
||||
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="comment">// // if true return information about transactions</span></div>
|
||||
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="comment">// // in the current TxQ, only if the requested</span></div>
|
||||
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="comment">// // ledger is open. Otherwise if true, returns an</span></div>
|
||||
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="comment">// // error.</span></div>
|
||||
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="comment">// }</span></div>
|
||||
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  </div>
|
||||
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="comment">// TODO(tom): what is that "default"?</span></div>
|
||||
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <a class="code" href="classJson_1_1Value.html">Json::Value</a></div>
|
||||
<div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="namespaceripple.html#ad3181666a917aca45f4f288e690e9305"> 50</a></span> <a class="code" href="namespaceripple.html#ad3181666a917aca45f4f288e690e9305">doAccountInfo</a>(<a class="code" href="structripple_1_1RPC_1_1JsonContext.html">RPC::JsonContext</a>& context)</div>
|
||||
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> {</div>
|
||||
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="keyword">auto</span>& params = context.<a class="code" href="structripple_1_1RPC_1_1JsonContext.html#a036b2c14552fbca49011c3d0e78017fa">params</a>;</div>
|
||||
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  </div>
|
||||
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> strIdent;</div>
|
||||
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="keywordflow">if</span> (params.isMember(jss::account))</div>
|
||||
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  strIdent = params[jss::account].asString();</div>
|
||||
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (params.isMember(jss::ident))</div>
|
||||
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  strIdent = params[jss::ident].asString();</div>
|
||||
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="keywordflow">return</span> <a class="code" href="namespaceripple_1_1RPC.html#aec2e1163b39a450d3917af9dd15b0f06">RPC::missing_field_error</a>(jss::account);</div>
|
||||
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  </div>
|
||||
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr<ReadView const></a> ledger;</div>
|
||||
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="keyword">auto</span> result = <a class="code" href="namespaceripple_1_1RPC.html#aaebfaaee35308269fab499f4e203a8c9">RPC::lookupLedger</a>(ledger, context);</div>
|
||||
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  </div>
|
||||
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="keywordflow">if</span> (!ledger)</div>
|
||||
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="keywordflow">return</span> result;</div>
|
||||
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  </div>
|
||||
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <span class="comment">// Get info on account.</span></div>
|
||||
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <span class="keyword">auto</span> <span class="keywordtype">id</span> = parseBase58<AccountID>(strIdent);</div>
|
||||
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="keywordflow">if</span> (!<span class="keywordtype">id</span>)</div>
|
||||
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  {</div>
|
||||
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <a class="code" href="namespaceripple_1_1RPC.html#a577bde9602a28f59e445c496f92a1ccf">RPC::inject_error</a>(<a class="code" href="namespaceripple.html#a32d6d3ce1a48272b677d2c88b1d30932a4fba57dbbed9bfaa196e1a0e0915dc8a">rpcACT_MALFORMED</a>, result);</div>
|
||||
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keywordflow">return</span> result;</div>
|
||||
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  }</div>
|
||||
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="keyword">auto</span> <span class="keyword">const</span> accountID{std::move(<span class="keywordtype">id</span>.value())};</div>
|
||||
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  </div>
|
||||
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="keywordflow">if</span> (jvAccepted)</div>
|
||||
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <span class="keywordflow">return</span> jvAccepted;</div>
|
||||
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  </div>
|
||||
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <span class="keyword">static</span> constexpr std::</div>
|
||||
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  array<std::pair<std::string_view, LedgerSpecificFlags>, 9></div>
|
||||
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  lsFlags{</div>
|
||||
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  {{<span class="stringliteral">"defaultRipple"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a3de81b62b486203f6b8e4f2cd0832ae1">lsfDefaultRipple</a>},</div>
|
||||
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  {<span class="stringliteral">"depositAuth"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a873a48eb9d8f66315874a318df664f05">lsfDepositAuth</a>},</div>
|
||||
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  {<span class="stringliteral">"disableMasterKey"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a74277ce2a45a0b253c18a4aa3c57b7c7">lsfDisableMaster</a>},</div>
|
||||
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  {<span class="stringliteral">"disallowIncomingXRP"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5af697f2c85dc33c5831e82b69c6a4e7e9">lsfDisallowXRP</a>},</div>
|
||||
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  {<span class="stringliteral">"globalFreeze"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5abe8166dd29a1d6890b51ce96af297f70">lsfGlobalFreeze</a>},</div>
|
||||
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  {<span class="stringliteral">"noFreeze"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5abe71ed0ad6b450dd8c2ffc0314318b79">lsfNoFreeze</a>},</div>
|
||||
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  {<span class="stringliteral">"passwordSpent"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a3023711a4bd27dad27a57290b0df1087">lsfPasswordSpent</a>},</div>
|
||||
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  {<span class="stringliteral">"requireAuthorization"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a44c3bc643086a0beb87e3aaeb544e6ad">lsfRequireAuth</a>},</div>
|
||||
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  {<span class="stringliteral">"requireDestinationTag"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a2243e81f83c4191286c8c46bdd86d6f3">lsfRequireDestTag</a>}}};</div>
|
||||
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  </div>
|
||||
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <span class="keyword">static</span> constexpr std::</div>
|
||||
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  array<std::pair<std::string_view, LedgerSpecificFlags>, 4></div>
|
||||
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  disallowIncomingFlags{</div>
|
||||
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  {{<span class="stringliteral">"disallowIncomingNFTokenOffer"</span>,</div>
|
||||
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a9f25924b110b0f2debce6e0f71bc5a18">lsfDisallowIncomingNFTokenOffer</a>},</div>
|
||||
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  {<span class="stringliteral">"disallowIncomingCheck"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a494f22c192b84673b1ff1e17e1b4304a">lsfDisallowIncomingCheck</a>},</div>
|
||||
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  {<span class="stringliteral">"disallowIncomingPayChan"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a91c443238e7e5acef466bfb2fe9f1211">lsfDisallowIncomingPayChan</a>},</div>
|
||||
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  {<span class="stringliteral">"disallowIncomingTrustline"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a99c52494bb88dab0264625ebc5c4206e">lsfDisallowIncomingTrustline</a>}}};</div>
|
||||
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  </div>
|
||||
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keyword">auto</span> <span class="keyword">const</span> sleAccepted = ledger-><a class="code" href="classripple_1_1ReadView.html#a3351e0244f921234d5ba005a07ddf539">read</a>(<a class="code" href="namespaceripple_1_1keylet.html#a50c370db96b4fdcdd202d9c2c38afce9">keylet::account</a>(accountID));</div>
|
||||
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="keywordflow">if</span> (sleAccepted)</div>
|
||||
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  {</div>
|
||||
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="keyword">auto</span> <span class="keyword">const</span> queue =</div>
|
||||
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  params.isMember(jss::queue) && params[jss::queue].asBool();</div>
|
||||
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  </div>
|
||||
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="keywordflow">if</span> (queue && !ledger-><a class="code" href="classripple_1_1ReadView.html#a8dc63ee1e4ae7b2f96823e146c53d03e">open</a>())</div>
|
||||
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  {</div>
|
||||
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="comment">// It doesn't make sense to request the queue</span></div>
|
||||
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="comment">// with any closed or validated ledger.</span></div>
|
||||
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <a class="code" href="namespaceripple_1_1RPC.html#a577bde9602a28f59e445c496f92a1ccf">RPC::inject_error</a>(<a class="code" href="namespaceripple.html#a32d6d3ce1a48272b677d2c88b1d30932a82ddebc5ec7a37ff38892487277bf9c4">rpcINVALID_PARAMS</a>, result);</div>
|
||||
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keywordflow">return</span> result;</div>
|
||||
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  }</div>
|
||||
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  </div>
|
||||
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <a class="code" href="namespaceripple_1_1RPC.html#a4ea6d08c0d50d738a6a55130a09ec238">RPC::injectSLE</a>(jvAccepted, *sleAccepted);</div>
|
||||
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  result[jss::account_data] = jvAccepted;</div>
|
||||
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  </div>
|
||||
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <a class="code" href="classJson_1_1Value.html">Json::Value</a> acctFlags{<a class="code" href="namespaceJson.html#a7d654b75c16a57007925868e38212b4eae8386dcfc36d1ae897745f7b4f77a1f6">Json::objectValue</a>};</div>
|
||||
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span>& lsf : lsFlags)</div>
|
||||
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  acctFlags[lsf.first.data()] = sleAccepted->isFlag(lsf.second);</div>
|
||||
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  </div>
|
||||
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <span class="keywordflow">if</span> (ledger-><a class="code" href="classripple_1_1ReadView.html#aaf2fa03be723bb78d8bdf41614a75a30">rules</a>().<a class="code" href="classripple_1_1Rules.html#a1a8388a2b9588aa9446ece92a88e0dd2">enabled</a>(<a class="code" href="namespaceripple.html#a2abe85419644def21413627f484a8df0">featureDisallowIncoming</a>))</div>
|
||||
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  {</div>
|
||||
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span>& lsf : disallowIncomingFlags)</div>
|
||||
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  acctFlags[lsf.first.data()] = sleAccepted->isFlag(lsf.second);</div>
|
||||
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  }</div>
|
||||
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  result[jss::account_flags] = std::move(acctFlags);</div>
|
||||
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  </div>
|
||||
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="comment">// Return SignerList(s) if that is requested.</span></div>
|
||||
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <span class="keywordflow">if</span> (params.isMember(jss::signer_lists) &&</div>
|
||||
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  params[jss::signer_lists].asBool())</div>
|
||||
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  {</div>
|
||||
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="comment">// We put the SignerList in an array because of an anticipated</span></div>
|
||||
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="comment">// future when we support multiple signer lists on one account.</span></div>
|
||||
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <a class="code" href="classJson_1_1Value.html">Json::Value</a> jvSignerList = <a class="code" href="namespaceJson.html#a7d654b75c16a57007925868e38212b4eadc8f264f36b55b063c78126b335415f4">Json::arrayValue</a>;</div>
|
||||
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  </div>
|
||||
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <span class="comment">// This code will need to be revisited if in the future we support</span></div>
|
||||
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <span class="comment">// multiple SignerLists on one account.</span></div>
|
||||
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <span class="keyword">auto</span> <span class="keyword">const</span> sleSigners = ledger-><a class="code" href="classripple_1_1ReadView.html#a3351e0244f921234d5ba005a07ddf539">read</a>(<a class="code" href="namespaceripple_1_1keylet.html#a732acf180c5009a2310b48a5fc4fbe43">keylet::signers</a>(accountID));</div>
|
||||
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <span class="keywordflow">if</span> (sleSigners)</div>
|
||||
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  jvSignerList.<a class="code" href="classJson_1_1Value.html#a7e49ac977e4bcf59745a09d426669f75">append</a>(sleSigners->getJson(<a class="code" href="namespaceripple.html#a169967ff418b80729654b6d45ade8711a334c4a4c42fdb79d7ebc3e73b517e6f8">JsonOptions::none</a>));</div>
|
||||
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  </div>
|
||||
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <span class="comment">// Documentation states this is returned as part of the account_info</span></div>
|
||||
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="comment">// response, but previously the code put it under account_data. We</span></div>
|
||||
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="comment">// can move this to the documentated location from apiVersion 2</span></div>
|
||||
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="comment">// onwards.</span></div>
|
||||
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keywordflow">if</span> (context.<a class="code" href="structripple_1_1RPC_1_1Context.html#a0eab3b46cc23d67a6d16d1fb6bcaf0a2">apiVersion</a> == 1)</div>
|
||||
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  {</div>
|
||||
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  result[jss::account_data][jss::signer_lists] =</div>
|
||||
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  std::move(jvSignerList);</div>
|
||||
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  }</div>
|
||||
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  {</div>
|
||||
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  result[jss::signer_lists] = std::move(jvSignerList);</div>
|
||||
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  }</div>
|
||||
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  }</div>
|
||||
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <span class="comment">// Return queue info if that is requested</span></div>
|
||||
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <span class="keywordflow">if</span> (queue)</div>
|
||||
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  {</div>
|
||||
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <a class="code" href="classJson_1_1Value.html">Json::Value</a> jvQueueData = <a class="code" href="namespaceJson.html#a7d654b75c16a57007925868e38212b4eae8386dcfc36d1ae897745f7b4f77a1f6">Json::objectValue</a>;</div>
|
||||
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  </div>
|
||||
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="keyword">auto</span> <span class="keyword">const</span> txs = context.<a class="code" href="structripple_1_1RPC_1_1Context.html#a7878751d68ed7fd43c385913c5e6ff04">app</a>.<a class="code" href="classripple_1_1Application.html#a9865710c130bf4427842a544b2b7f077">getTxQ</a>().<a class="code" href="classripple_1_1TxQ.html#a459d2ac82dc4e7e5672db06df4618a96">getAccountTxs</a>(accountID);</div>
|
||||
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <span class="keywordflow">if</span> (!txs.empty())</div>
|
||||
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  {</div>
|
||||
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  jvQueueData[jss::txn_count] =</div>
|
||||
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  <span class="keyword">static_cast<</span><a class="code" href="namespaceJson.html#ab1488c31a37eea2d37f36a0961372572">Json::UInt</a><span class="keyword">></span>(txs.size());</div>
|
||||
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  </div>
|
||||
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="keyword">auto</span>& jvQueueTx = jvQueueData[jss::transactions];</div>
|
||||
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  jvQueueTx = <a class="code" href="namespaceJson.html#a7d654b75c16a57007925868e38212b4eadc8f264f36b55b063c78126b335415f4">Json::arrayValue</a>;</div>
|
||||
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  </div>
|
||||
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> seqCount = 0;</div>
|
||||
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> ticketCount = 0;</div>
|
||||
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional<std::uint32_t></a> lowestSeq;</div>
|
||||
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional<std::uint32_t></a> highestSeq;</div>
|
||||
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional<std::uint32_t></a> lowestTicket;</div>
|
||||
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional<std::uint32_t></a> highestTicket;</div>
|
||||
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  <span class="keywordtype">bool</span> anyAuthChanged = <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <a class="code" href="classripple_1_1XRPAmount.html">XRPAmount</a> totalSpend(0);</div>
|
||||
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  </div>
|
||||
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  <span class="comment">// We expect txs to be returned sorted by SeqProxy. Verify</span></div>
|
||||
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <span class="comment">// that with a couple of asserts.</span></div>
|
||||
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <a class="code" href="classripple_1_1SeqProxy.html">SeqProxy</a> prevSeqProxy = <a class="code" href="classripple_1_1SeqProxy.html#a31a7a3c8298a38aaeee20ae08bb51643">SeqProxy::sequence</a>(0);</div>
|
||||
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span>& tx : txs)</div>
|
||||
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  {</div>
|
||||
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <a class="code" href="classJson_1_1Value.html">Json::Value</a> jvTx = <a class="code" href="namespaceJson.html#a7d654b75c16a57007925868e38212b4eae8386dcfc36d1ae897745f7b4f77a1f6">Json::objectValue</a>;</div>
|
||||
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  </div>
|
||||
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="keywordflow">if</span> (tx.seqProxy.isSeq())</div>
|
||||
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  {</div>
|
||||
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  assert(prevSeqProxy < tx.seqProxy);</div>
|
||||
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  prevSeqProxy = tx.seqProxy;</div>
|
||||
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  jvTx[jss::seq] = tx.seqProxy.value();</div>
|
||||
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  ++seqCount;</div>
|
||||
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <span class="keywordflow">if</span> (!lowestSeq)</div>
|
||||
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  lowestSeq = tx.seqProxy.<a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional/value.html">value</a>();</div>
|
||||
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  highestSeq = tx.seqProxy.<a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional/value.html">value</a>();</div>
|
||||
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  }</div>
|
||||
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  {</div>
|
||||
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  assert(prevSeqProxy < tx.seqProxy);</div>
|
||||
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  prevSeqProxy = tx.seqProxy;</div>
|
||||
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  jvTx[jss::ticket] = tx.seqProxy.value();</div>
|
||||
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  ++ticketCount;</div>
|
||||
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  <span class="keywordflow">if</span> (!lowestTicket)</div>
|
||||
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  lowestTicket = tx.seqProxy.<a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional/value.html">value</a>();</div>
|
||||
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  highestTicket = tx.seqProxy.<a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional/value.html">value</a>();</div>
|
||||
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  }</div>
|
||||
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  </div>
|
||||
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  jvTx[jss::fee_level] = <a class="code" href="namespaceripple.html#af9776f187d3686a7fba4c2d2fbeebdf4">to_string</a>(tx.feeLevel);</div>
|
||||
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  <span class="keywordflow">if</span> (tx.lastValid)</div>
|
||||
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  jvTx[jss::LastLedgerSequence] = *tx.lastValid;</div>
|
||||
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  </div>
|
||||
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  jvTx[jss::fee] = <a class="code" href="namespaceripple.html#af9776f187d3686a7fba4c2d2fbeebdf4">to_string</a>(tx.consequences.fee());</div>
|
||||
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <span class="keyword">auto</span> <span class="keyword">const</span> spend = tx.consequences.potentialSpend() +</div>
|
||||
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  tx.consequences.fee();</div>
|
||||
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  jvTx[jss::max_spend_drops] = <a class="code" href="namespaceripple.html#af9776f187d3686a7fba4c2d2fbeebdf4">to_string</a>(spend);</div>
|
||||
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  totalSpend += spend;</div>
|
||||
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  <span class="keywordtype">bool</span> <span class="keyword">const</span> authChanged = tx.consequences.isBlocker();</div>
|
||||
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <span class="keywordflow">if</span> (authChanged)</div>
|
||||
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  anyAuthChanged = authChanged;</div>
|
||||
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  jvTx[jss::auth_change] = authChanged;</div>
|
||||
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  </div>
|
||||
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  jvQueueTx.<a class="code" href="classJson_1_1Value.html#a7e49ac977e4bcf59745a09d426669f75">append</a>(std::move(jvTx));</div>
|
||||
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  }</div>
|
||||
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  </div>
|
||||
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="keywordflow">if</span> (seqCount)</div>
|
||||
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  jvQueueData[jss::sequence_count] = seqCount;</div>
|
||||
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  <span class="keywordflow">if</span> (ticketCount)</div>
|
||||
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  jvQueueData[jss::ticket_count] = ticketCount;</div>
|
||||
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="keywordflow">if</span> (lowestSeq)</div>
|
||||
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  jvQueueData[jss::lowest_sequence] = *lowestSeq;</div>
|
||||
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  <span class="keywordflow">if</span> (highestSeq)</div>
|
||||
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  jvQueueData[jss::highest_sequence] = *highestSeq;</div>
|
||||
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  <span class="keywordflow">if</span> (lowestTicket)</div>
|
||||
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  jvQueueData[jss::lowest_ticket] = *lowestTicket;</div>
|
||||
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  <span class="keywordflow">if</span> (highestTicket)</div>
|
||||
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  jvQueueData[jss::highest_ticket] = *highestTicket;</div>
|
||||
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  </div>
|
||||
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  jvQueueData[jss::auth_change_queued] = anyAuthChanged;</div>
|
||||
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  jvQueueData[jss::max_spend_drops_total] = <a class="code" href="namespaceripple.html#af9776f187d3686a7fba4c2d2fbeebdf4">to_string</a>(totalSpend);</div>
|
||||
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  }</div>
|
||||
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  jvQueueData[jss::txn_count] = 0u;</div>
|
||||
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  </div>
|
||||
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  result[jss::queue_data] = std::move(jvQueueData);</div>
|
||||
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  }</div>
|
||||
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  }</div>
|
||||
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  {</div>
|
||||
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  result[jss::account] = <a class="code" href="namespaceripple.html#a08a13b62b18272366f788632359e8793">toBase58</a>(accountID);</div>
|
||||
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  <a class="code" href="namespaceripple_1_1RPC.html#a577bde9602a28f59e445c496f92a1ccf">RPC::inject_error</a>(<a class="code" href="namespaceripple.html#a32d6d3ce1a48272b677d2c88b1d30932a044301ed3c32624aade5888d1c60566f">rpcACT_NOT_FOUND</a>, result);</div>
|
||||
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  }</div>
|
||||
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  </div>
|
||||
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  <span class="keywordflow">return</span> result;</div>
|
||||
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span> }</div>
|
||||
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  </div>
|
||||
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span> } <span class="comment">// namespace ripple</span></div>
|
||||
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="keyword">static</span> constexpr std::</div>
|
||||
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  array<std::pair<std::string_view, LedgerSpecificFlags>, 9></div>
|
||||
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  lsFlags{</div>
|
||||
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  {{<span class="stringliteral">"defaultRipple"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a3de81b62b486203f6b8e4f2cd0832ae1">lsfDefaultRipple</a>},</div>
|
||||
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  {<span class="stringliteral">"depositAuth"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a873a48eb9d8f66315874a318df664f05">lsfDepositAuth</a>},</div>
|
||||
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  {<span class="stringliteral">"disableMasterKey"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a74277ce2a45a0b253c18a4aa3c57b7c7">lsfDisableMaster</a>},</div>
|
||||
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  {<span class="stringliteral">"disallowIncomingXRP"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5af697f2c85dc33c5831e82b69c6a4e7e9">lsfDisallowXRP</a>},</div>
|
||||
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  {<span class="stringliteral">"globalFreeze"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5abe8166dd29a1d6890b51ce96af297f70">lsfGlobalFreeze</a>},</div>
|
||||
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  {<span class="stringliteral">"noFreeze"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5abe71ed0ad6b450dd8c2ffc0314318b79">lsfNoFreeze</a>},</div>
|
||||
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  {<span class="stringliteral">"passwordSpent"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a3023711a4bd27dad27a57290b0df1087">lsfPasswordSpent</a>},</div>
|
||||
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  {<span class="stringliteral">"requireAuthorization"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a44c3bc643086a0beb87e3aaeb544e6ad">lsfRequireAuth</a>},</div>
|
||||
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  {<span class="stringliteral">"requireDestinationTag"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a2243e81f83c4191286c8c46bdd86d6f3">lsfRequireDestTag</a>}}};</div>
|
||||
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  </div>
|
||||
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="keyword">static</span> constexpr std::</div>
|
||||
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  array<std::pair<std::string_view, LedgerSpecificFlags>, 4></div>
|
||||
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  disallowIncomingFlags{</div>
|
||||
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  {{<span class="stringliteral">"disallowIncomingNFTokenOffer"</span>,</div>
|
||||
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a9f25924b110b0f2debce6e0f71bc5a18">lsfDisallowIncomingNFTokenOffer</a>},</div>
|
||||
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  {<span class="stringliteral">"disallowIncomingCheck"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a494f22c192b84673b1ff1e17e1b4304a">lsfDisallowIncomingCheck</a>},</div>
|
||||
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  {<span class="stringliteral">"disallowIncomingPayChan"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a91c443238e7e5acef466bfb2fe9f1211">lsfDisallowIncomingPayChan</a>},</div>
|
||||
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  {<span class="stringliteral">"disallowIncomingTrustline"</span>, <a class="code" href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a99c52494bb88dab0264625ebc5c4206e">lsfDisallowIncomingTrustline</a>}}};</div>
|
||||
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  </div>
|
||||
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="keyword">auto</span> <span class="keyword">const</span> sleAccepted = ledger-><a class="code" href="classripple_1_1ReadView.html#a3351e0244f921234d5ba005a07ddf539">read</a>(<a class="code" href="namespaceripple_1_1keylet.html#a50c370db96b4fdcdd202d9c2c38afce9">keylet::account</a>(accountID));</div>
|
||||
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="keywordflow">if</span> (sleAccepted)</div>
|
||||
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  {</div>
|
||||
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keyword">auto</span> <span class="keyword">const</span> queue =</div>
|
||||
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  params.isMember(jss::queue) && params[jss::queue].asBool();</div>
|
||||
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  </div>
|
||||
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="keywordflow">if</span> (queue && !ledger-><a class="code" href="classripple_1_1ReadView.html#a8dc63ee1e4ae7b2f96823e146c53d03e">open</a>())</div>
|
||||
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  {</div>
|
||||
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="comment">// It doesn't make sense to request the queue</span></div>
|
||||
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="comment">// with any closed or validated ledger.</span></div>
|
||||
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <a class="code" href="namespaceripple_1_1RPC.html#a577bde9602a28f59e445c496f92a1ccf">RPC::inject_error</a>(<a class="code" href="namespaceripple.html#a32d6d3ce1a48272b677d2c88b1d30932a82ddebc5ec7a37ff38892487277bf9c4">rpcINVALID_PARAMS</a>, result);</div>
|
||||
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="keywordflow">return</span> result;</div>
|
||||
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  }</div>
|
||||
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  </div>
|
||||
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <a class="code" href="classJson_1_1Value.html">Json::Value</a> jvAccepted(<a class="code" href="namespaceJson.html#a7d654b75c16a57007925868e38212b4eae8386dcfc36d1ae897745f7b4f77a1f6">Json::objectValue</a>);</div>
|
||||
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <a class="code" href="namespaceripple_1_1RPC.html#a4ea6d08c0d50d738a6a55130a09ec238">RPC::injectSLE</a>(jvAccepted, *sleAccepted);</div>
|
||||
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  result[jss::account_data] = jvAccepted;</div>
|
||||
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  </div>
|
||||
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <a class="code" href="classJson_1_1Value.html">Json::Value</a> acctFlags{<a class="code" href="namespaceJson.html#a7d654b75c16a57007925868e38212b4eae8386dcfc36d1ae897745f7b4f77a1f6">Json::objectValue</a>};</div>
|
||||
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span>& lsf : lsFlags)</div>
|
||||
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  acctFlags[lsf.first.data()] = sleAccepted->isFlag(lsf.second);</div>
|
||||
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  </div>
|
||||
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="keywordflow">if</span> (ledger-><a class="code" href="classripple_1_1ReadView.html#aaf2fa03be723bb78d8bdf41614a75a30">rules</a>().<a class="code" href="classripple_1_1Rules.html#a1a8388a2b9588aa9446ece92a88e0dd2">enabled</a>(<a class="code" href="namespaceripple.html#a2abe85419644def21413627f484a8df0">featureDisallowIncoming</a>))</div>
|
||||
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  {</div>
|
||||
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span>& lsf : disallowIncomingFlags)</div>
|
||||
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  acctFlags[lsf.first.data()] = sleAccepted->isFlag(lsf.second);</div>
|
||||
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  }</div>
|
||||
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  result[jss::account_flags] = std::move(acctFlags);</div>
|
||||
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  </div>
|
||||
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="comment">// Return SignerList(s) if that is requested.</span></div>
|
||||
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keywordflow">if</span> (params.isMember(jss::signer_lists) &&</div>
|
||||
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  params[jss::signer_lists].asBool())</div>
|
||||
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  {</div>
|
||||
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <span class="comment">// We put the SignerList in an array because of an anticipated</span></div>
|
||||
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="comment">// future when we support multiple signer lists on one account.</span></div>
|
||||
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <a class="code" href="classJson_1_1Value.html">Json::Value</a> jvSignerList = <a class="code" href="namespaceJson.html#a7d654b75c16a57007925868e38212b4eadc8f264f36b55b063c78126b335415f4">Json::arrayValue</a>;</div>
|
||||
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  </div>
|
||||
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="comment">// This code will need to be revisited if in the future we support</span></div>
|
||||
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="comment">// multiple SignerLists on one account.</span></div>
|
||||
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <span class="keyword">auto</span> <span class="keyword">const</span> sleSigners = ledger-><a class="code" href="classripple_1_1ReadView.html#a3351e0244f921234d5ba005a07ddf539">read</a>(<a class="code" href="namespaceripple_1_1keylet.html#a732acf180c5009a2310b48a5fc4fbe43">keylet::signers</a>(accountID));</div>
|
||||
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <span class="keywordflow">if</span> (sleSigners)</div>
|
||||
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  jvSignerList.<a class="code" href="classJson_1_1Value.html#a7e49ac977e4bcf59745a09d426669f75">append</a>(sleSigners->getJson(<a class="code" href="namespaceripple.html#a169967ff418b80729654b6d45ade8711a334c4a4c42fdb79d7ebc3e73b517e6f8">JsonOptions::none</a>));</div>
|
||||
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  </div>
|
||||
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="comment">// Documentation states this is returned as part of the account_info</span></div>
|
||||
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <span class="comment">// response, but previously the code put it under account_data. We</span></div>
|
||||
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <span class="comment">// can move this to the documentated location from apiVersion 2</span></div>
|
||||
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="comment">// onwards.</span></div>
|
||||
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="keywordflow">if</span> (context.<a class="code" href="structripple_1_1RPC_1_1Context.html#a0eab3b46cc23d67a6d16d1fb6bcaf0a2">apiVersion</a> == 1)</div>
|
||||
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  {</div>
|
||||
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  result[jss::account_data][jss::signer_lists] =</div>
|
||||
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  std::move(jvSignerList);</div>
|
||||
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  }</div>
|
||||
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  {</div>
|
||||
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  result[jss::signer_lists] = std::move(jvSignerList);</div>
|
||||
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  }</div>
|
||||
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  }</div>
|
||||
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="comment">// Return queue info if that is requested</span></div>
|
||||
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <span class="keywordflow">if</span> (queue)</div>
|
||||
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  {</div>
|
||||
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <a class="code" href="classJson_1_1Value.html">Json::Value</a> jvQueueData = <a class="code" href="namespaceJson.html#a7d654b75c16a57007925868e38212b4eae8386dcfc36d1ae897745f7b4f77a1f6">Json::objectValue</a>;</div>
|
||||
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  </div>
|
||||
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keyword">auto</span> <span class="keyword">const</span> txs = context.<a class="code" href="structripple_1_1RPC_1_1Context.html#a7878751d68ed7fd43c385913c5e6ff04">app</a>.<a class="code" href="classripple_1_1Application.html#a9865710c130bf4427842a544b2b7f077">getTxQ</a>().<a class="code" href="classripple_1_1TxQ.html#a459d2ac82dc4e7e5672db06df4618a96">getAccountTxs</a>(accountID);</div>
|
||||
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  <span class="keywordflow">if</span> (!txs.empty())</div>
|
||||
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  {</div>
|
||||
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  jvQueueData[jss::txn_count] =</div>
|
||||
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  <span class="keyword">static_cast<</span><a class="code" href="namespaceJson.html#ab1488c31a37eea2d37f36a0961372572">Json::UInt</a><span class="keyword">></span>(txs.size());</div>
|
||||
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  </div>
|
||||
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  <span class="keyword">auto</span>& jvQueueTx = jvQueueData[jss::transactions];</div>
|
||||
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  jvQueueTx = <a class="code" href="namespaceJson.html#a7d654b75c16a57007925868e38212b4eadc8f264f36b55b063c78126b335415f4">Json::arrayValue</a>;</div>
|
||||
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  </div>
|
||||
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> seqCount = 0;</div>
|
||||
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> ticketCount = 0;</div>
|
||||
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional<std::uint32_t></a> lowestSeq;</div>
|
||||
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional<std::uint32_t></a> highestSeq;</div>
|
||||
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional<std::uint32_t></a> lowestTicket;</div>
|
||||
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional<std::uint32_t></a> highestTicket;</div>
|
||||
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <span class="keywordtype">bool</span> anyAuthChanged = <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <a class="code" href="classripple_1_1XRPAmount.html">XRPAmount</a> totalSpend(0);</div>
|
||||
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  </div>
|
||||
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="comment">// We expect txs to be returned sorted by SeqProxy. Verify</span></div>
|
||||
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="comment">// that with a couple of asserts.</span></div>
|
||||
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  <a class="code" href="classripple_1_1SeqProxy.html">SeqProxy</a> prevSeqProxy = <a class="code" href="classripple_1_1SeqProxy.html#a31a7a3c8298a38aaeee20ae08bb51643">SeqProxy::sequence</a>(0);</div>
|
||||
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span>& tx : txs)</div>
|
||||
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  {</div>
|
||||
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <a class="code" href="classJson_1_1Value.html">Json::Value</a> jvTx = <a class="code" href="namespaceJson.html#a7d654b75c16a57007925868e38212b4eae8386dcfc36d1ae897745f7b4f77a1f6">Json::objectValue</a>;</div>
|
||||
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  </div>
|
||||
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <span class="keywordflow">if</span> (tx.seqProxy.isSeq())</div>
|
||||
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  {</div>
|
||||
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  assert(prevSeqProxy < tx.seqProxy);</div>
|
||||
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  prevSeqProxy = tx.seqProxy;</div>
|
||||
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  jvTx[jss::seq] = tx.seqProxy.value();</div>
|
||||
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  ++seqCount;</div>
|
||||
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="keywordflow">if</span> (!lowestSeq)</div>
|
||||
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  lowestSeq = tx.seqProxy.<a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional/value.html">value</a>();</div>
|
||||
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  highestSeq = tx.seqProxy.<a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional/value.html">value</a>();</div>
|
||||
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  }</div>
|
||||
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  {</div>
|
||||
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  assert(prevSeqProxy < tx.seqProxy);</div>
|
||||
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  prevSeqProxy = tx.seqProxy;</div>
|
||||
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  jvTx[jss::ticket] = tx.seqProxy.value();</div>
|
||||
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  ++ticketCount;</div>
|
||||
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="keywordflow">if</span> (!lowestTicket)</div>
|
||||
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  lowestTicket = tx.seqProxy.<a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional/value.html">value</a>();</div>
|
||||
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  highestTicket = tx.seqProxy.<a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional/value.html">value</a>();</div>
|
||||
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  }</div>
|
||||
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  </div>
|
||||
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  jvTx[jss::fee_level] = <a class="code" href="namespaceripple.html#af9776f187d3686a7fba4c2d2fbeebdf4">to_string</a>(tx.feeLevel);</div>
|
||||
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <span class="keywordflow">if</span> (tx.lastValid)</div>
|
||||
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  jvTx[jss::LastLedgerSequence] = *tx.lastValid;</div>
|
||||
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  </div>
|
||||
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  jvTx[jss::fee] = <a class="code" href="namespaceripple.html#af9776f187d3686a7fba4c2d2fbeebdf4">to_string</a>(tx.consequences.fee());</div>
|
||||
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  <span class="keyword">auto</span> <span class="keyword">const</span> spend = tx.consequences.potentialSpend() +</div>
|
||||
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  tx.consequences.fee();</div>
|
||||
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  jvTx[jss::max_spend_drops] = <a class="code" href="namespaceripple.html#af9776f187d3686a7fba4c2d2fbeebdf4">to_string</a>(spend);</div>
|
||||
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  totalSpend += spend;</div>
|
||||
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  <span class="keywordtype">bool</span> <span class="keyword">const</span> authChanged = tx.consequences.isBlocker();</div>
|
||||
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <span class="keywordflow">if</span> (authChanged)</div>
|
||||
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  anyAuthChanged = authChanged;</div>
|
||||
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  jvTx[jss::auth_change] = authChanged;</div>
|
||||
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  </div>
|
||||
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  jvQueueTx.<a class="code" href="classJson_1_1Value.html#a7e49ac977e4bcf59745a09d426669f75">append</a>(std::move(jvTx));</div>
|
||||
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  }</div>
|
||||
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  </div>
|
||||
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <span class="keywordflow">if</span> (seqCount)</div>
|
||||
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  jvQueueData[jss::sequence_count] = seqCount;</div>
|
||||
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="keywordflow">if</span> (ticketCount)</div>
|
||||
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  jvQueueData[jss::ticket_count] = ticketCount;</div>
|
||||
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  <span class="keywordflow">if</span> (lowestSeq)</div>
|
||||
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  jvQueueData[jss::lowest_sequence] = *lowestSeq;</div>
|
||||
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="keywordflow">if</span> (highestSeq)</div>
|
||||
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  jvQueueData[jss::highest_sequence] = *highestSeq;</div>
|
||||
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  <span class="keywordflow">if</span> (lowestTicket)</div>
|
||||
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  jvQueueData[jss::lowest_ticket] = *lowestTicket;</div>
|
||||
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  <span class="keywordflow">if</span> (highestTicket)</div>
|
||||
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  jvQueueData[jss::highest_ticket] = *highestTicket;</div>
|
||||
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  </div>
|
||||
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  jvQueueData[jss::auth_change_queued] = anyAuthChanged;</div>
|
||||
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  jvQueueData[jss::max_spend_drops_total] = <a class="code" href="namespaceripple.html#af9776f187d3686a7fba4c2d2fbeebdf4">to_string</a>(totalSpend);</div>
|
||||
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  }</div>
|
||||
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  jvQueueData[jss::txn_count] = 0u;</div>
|
||||
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  </div>
|
||||
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  result[jss::queue_data] = std::move(jvQueueData);</div>
|
||||
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  }</div>
|
||||
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  }</div>
|
||||
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  {</div>
|
||||
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  result[jss::account] = <a class="code" href="namespaceripple.html#a08a13b62b18272366f788632359e8793">toBase58</a>(accountID);</div>
|
||||
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  <a class="code" href="namespaceripple_1_1RPC.html#a577bde9602a28f59e445c496f92a1ccf">RPC::inject_error</a>(<a class="code" href="namespaceripple.html#a32d6d3ce1a48272b677d2c88b1d30932a044301ed3c32624aade5888d1c60566f">rpcACT_NOT_FOUND</a>, result);</div>
|
||||
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  }</div>
|
||||
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  </div>
|
||||
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  <span class="keywordflow">return</span> result;</div>
|
||||
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span> }</div>
|
||||
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  </div>
|
||||
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span> } <span class="comment">// namespace ripple</span></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
<div class="ttc" id="astructripple_1_1RPC_1_1JsonContext_html"><div class="ttname"><a href="structripple_1_1RPC_1_1JsonContext.html">ripple::RPC::JsonContext</a></div><div class="ttdef"><b>Definition:</b> <a href="Context_8h_source.html#l00053">Context.h:53</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_a4a9c7b33fef9015d6406302ef80b63c5a3023711a4bd27dad27a57290b0df1087"><div class="ttname"><a href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a3023711a4bd27dad27a57290b0df1087">ripple::lsfPasswordSpent</a></div><div class="ttdeci">@ lsfPasswordSpent</div><div class="ttdef"><b>Definition:</b> <a href="LedgerFormats_8h_source.html#l00223">LedgerFormats.h:223</a></div></div>
|
||||
@@ -334,7 +332,7 @@ $(function() {
|
||||
<div class="ttc" id="aclassripple_1_1Rules_html_a1a8388a2b9588aa9446ece92a88e0dd2"><div class="ttname"><a href="classripple_1_1Rules.html#a1a8388a2b9588aa9446ece92a88e0dd2">ripple::Rules::enabled</a></div><div class="ttdeci">bool enabled(uint256 const &feature) const</div><div class="ttdoc">Returns true if a feature is enabled.</div><div class="ttdef"><b>Definition:</b> <a href="Rules_8cpp_source.html#l00094">Rules.cpp:94</a></div></div>
|
||||
<div class="ttc" id="ashared_ptr_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr</a></div><div class="ttdoc">STL class.</div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_a32d6d3ce1a48272b677d2c88b1d30932a82ddebc5ec7a37ff38892487277bf9c4"><div class="ttname"><a href="namespaceripple.html#a32d6d3ce1a48272b677d2c88b1d30932a82ddebc5ec7a37ff38892487277bf9c4">ripple::rpcINVALID_PARAMS</a></div><div class="ttdeci">@ rpcINVALID_PARAMS</div><div class="ttdef"><b>Definition:</b> <a href="ErrorCodes_8h_source.html#l00084">ErrorCodes.h:84</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_ad3181666a917aca45f4f288e690e9305"><div class="ttname"><a href="namespaceripple.html#ad3181666a917aca45f4f288e690e9305">ripple::doAccountInfo</a></div><div class="ttdeci">Json::Value doAccountInfo(RPC::JsonContext &context)</div><div class="ttdef"><b>Definition:</b> <a href="AccountInfo_8cpp_source.html#l00052">AccountInfo.cpp:52</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_ad3181666a917aca45f4f288e690e9305"><div class="ttname"><a href="namespaceripple.html#ad3181666a917aca45f4f288e690e9305">ripple::doAccountInfo</a></div><div class="ttdeci">Json::Value doAccountInfo(RPC::JsonContext &context)</div><div class="ttdef"><b>Definition:</b> <a href="AccountInfo_8cpp_source.html#l00050">AccountInfo.cpp:50</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_a4a9c7b33fef9015d6406302ef80b63c5a74277ce2a45a0b253c18a4aa3c57b7c7"><div class="ttname"><a href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a74277ce2a45a0b253c18a4aa3c57b7c7">ripple::lsfDisableMaster</a></div><div class="ttdeci">@ lsfDisableMaster</div><div class="ttdef"><b>Definition:</b> <a href="LedgerFormats_8h_source.html#l00229">LedgerFormats.h:229</a></div></div>
|
||||
<div class="ttc" id="anamespaceJson_html_a7d654b75c16a57007925868e38212b4eadc8f264f36b55b063c78126b335415f4"><div class="ttname"><a href="namespaceJson.html#a7d654b75c16a57007925868e38212b4eadc8f264f36b55b063c78126b335415f4">Json::arrayValue</a></div><div class="ttdeci">@ arrayValue</div><div class="ttdoc">array value (ordered list)</div><div class="ttdef"><b>Definition:</b> <a href="json__value_8h_source.html#l00042">json_value.h:42</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_1_1RPC_html_a4ea6d08c0d50d738a6a55130a09ec238"><div class="ttname"><a href="namespaceripple_1_1RPC.html#a4ea6d08c0d50d738a6a55130a09ec238">ripple::RPC::injectSLE</a></div><div class="ttdeci">void injectSLE(Json::Value &jv, SLE const &sle)</div><div class="ttdoc">Inject JSON describing ledger entry.</div><div class="ttdef"><b>Definition:</b> <a href="RPCHelpers_8cpp_source.html#l00727">RPCHelpers.cpp:727</a></div></div>
|
||||
@@ -344,7 +342,6 @@ $(function() {
|
||||
<div class="ttc" id="anamespaceripple_1_1RPC_html_aaebfaaee35308269fab499f4e203a8c9"><div class="ttname"><a href="namespaceripple_1_1RPC.html#aaebfaaee35308269fab499f4e203a8c9">ripple::RPC::lookupLedger</a></div><div class="ttdeci">Status lookupLedger(std::shared_ptr< ReadView const > &ledger, JsonContext &context, Json::Value &result)</div><div class="ttdoc">Look up a ledger from a request and fill a Json::Result with the data representing a ledger.</div><div class="ttdef"><b>Definition:</b> <a href="RPCHelpers_8cpp_source.html#l00675">RPCHelpers.cpp:675</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_a4a9c7b33fef9015d6406302ef80b63c5a873a48eb9d8f66315874a318df664f05"><div class="ttname"><a href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a873a48eb9d8f66315874a318df664f05">ripple::lsfDepositAuth</a></div><div class="ttdeci">@ lsfDepositAuth</div><div class="ttdef"><b>Definition:</b> <a href="LedgerFormats_8h_source.html#l00234">LedgerFormats.h:234</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_1_1RPC_html_aec2e1163b39a450d3917af9dd15b0f06"><div class="ttname"><a href="namespaceripple_1_1RPC.html#aec2e1163b39a450d3917af9dd15b0f06">ripple::RPC::missing_field_error</a></div><div class="ttdeci">Json::Value missing_field_error(std::string const &name)</div><div class="ttdef"><b>Definition:</b> <a href="ErrorCodes_8h_source.html#l00262">ErrorCodes.h:262</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1base__uint_html"><div class="ttname"><a href="classripple_1_1base__uint.html">ripple::base_uint</a></div><div class="ttdoc">Integers of any length that is a multiple of 32-bits.</div><div class="ttdef"><b>Definition:</b> <a href="base__uint_8h_source.html#l00082">base_uint.h:82</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_a4a9c7b33fef9015d6406302ef80b63c5a44c3bc643086a0beb87e3aaeb544e6ad"><div class="ttname"><a href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a44c3bc643086a0beb87e3aaeb544e6ad">ripple::lsfRequireAuth</a></div><div class="ttdeci">@ lsfRequireAuth</div><div class="ttdef"><b>Definition:</b> <a href="LedgerFormats_8h_source.html#l00226">LedgerFormats.h:226</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_a4a9c7b33fef9015d6406302ef80b63c5a3de81b62b486203f6b8e4f2cd0832ae1"><div class="ttname"><a href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a3de81b62b486203f6b8e4f2cd0832ae1">ripple::lsfDefaultRipple</a></div><div class="ttdeci">@ lsfDefaultRipple</div><div class="ttdef"><b>Definition:</b> <a href="LedgerFormats_8h_source.html#l00232">LedgerFormats.h:232</a></div></div>
|
||||
<div class="ttc" id="aclassJson_1_1Value_html_a7e49ac977e4bcf59745a09d426669f75"><div class="ttname"><a href="classJson_1_1Value.html#a7e49ac977e4bcf59745a09d426669f75">Json::Value::append</a></div><div class="ttdeci">Value & append(const Value &value)</div><div class="ttdoc">Append value to array at the end.</div><div class="ttdef"><b>Definition:</b> <a href="json__value_8cpp_source.html#l00882">json_value.cpp:882</a></div></div>
|
||||
@@ -362,6 +359,7 @@ $(function() {
|
||||
<div class="ttc" id="anamespaceripple_html_a4a9c7b33fef9015d6406302ef80b63c5a2243e81f83c4191286c8c46bdd86d6f3"><div class="ttname"><a href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a2243e81f83c4191286c8c46bdd86d6f3">ripple::lsfRequireDestTag</a></div><div class="ttdeci">@ lsfRequireDestTag</div><div class="ttdef"><b>Definition:</b> <a href="LedgerFormats_8h_source.html#l00224">LedgerFormats.h:224</a></div></div>
|
||||
<div class="ttc" id="avalue_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/optional/value.html">std::optional::value</a></div><div class="ttdeci">T value(T... args)</div></div>
|
||||
<div class="ttc" id="anamespaceripple_html"><div class="ttname"><a href="namespaceripple.html">ripple</a></div><div class="ttdoc">Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.</div><div class="ttdef"><b>Definition:</b> <a href="RCLCensorshipDetector_8h_source.html#l00029">RCLCensorshipDetector.h:29</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_a32d6d3ce1a48272b677d2c88b1d30932a4fba57dbbed9bfaa196e1a0e0915dc8a"><div class="ttname"><a href="namespaceripple.html#a32d6d3ce1a48272b677d2c88b1d30932a4fba57dbbed9bfaa196e1a0e0915dc8a">ripple::rpcACT_MALFORMED</a></div><div class="ttdeci">@ rpcACT_MALFORMED</div><div class="ttdef"><b>Definition:</b> <a href="ErrorCodes_8h_source.html#l00090">ErrorCodes.h:90</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_a4a9c7b33fef9015d6406302ef80b63c5a9f25924b110b0f2debce6e0f71bc5a18"><div class="ttname"><a href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a9f25924b110b0f2debce6e0f71bc5a18">ripple::lsfDisallowIncomingNFTokenOffer</a></div><div class="ttdeci">@ lsfDisallowIncomingNFTokenOffer</div><div class="ttdef"><b>Definition:</b> <a href="LedgerFormats_8h_source.html#l00238">LedgerFormats.h:238</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1ReadView_html_aaf2fa03be723bb78d8bdf41614a75a30"><div class="ttname"><a href="classripple_1_1ReadView.html#aaf2fa03be723bb78d8bdf41614a75a30">ripple::ReadView::rules</a></div><div class="ttdeci">virtual Rules const & rules() const =0</div><div class="ttdoc">Returns the tx processing rules.</div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_a4a9c7b33fef9015d6406302ef80b63c5abe71ed0ad6b450dd8c2ffc0314318b79"><div class="ttname"><a href="namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5abe71ed0ad6b450dd8c2ffc0314318b79">ripple::lsfNoFreeze</a></div><div class="ttdeci">@ lsfNoFreeze</div><div class="ttdef"><b>Definition:</b> <a href="LedgerFormats_8h_source.html#l00230">LedgerFormats.h:230</a></div></div>
|
||||
@@ -376,7 +374,6 @@ $(function() {
|
||||
<div class="ttc" id="aclassripple_1_1ReadView_html_a8dc63ee1e4ae7b2f96823e146c53d03e"><div class="ttname"><a href="classripple_1_1ReadView.html#a8dc63ee1e4ae7b2f96823e146c53d03e">ripple::ReadView::open</a></div><div class="ttdeci">virtual bool open() const =0</div><div class="ttdoc">Returns true if this reflects an open ledger.</div></div>
|
||||
<div class="ttc" id="astructripple_1_1RPC_1_1JsonContext_html_a036b2c14552fbca49011c3d0e78017fa"><div class="ttname"><a href="structripple_1_1RPC_1_1JsonContext.html#a036b2c14552fbca49011c3d0e78017fa">ripple::RPC::JsonContext::params</a></div><div class="ttdeci">Json::Value params</div><div class="ttdef"><b>Definition:</b> <a href="Context_8h_source.html#l00064">Context.h:64</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_1_1RPC_html_a577bde9602a28f59e445c496f92a1ccf"><div class="ttname"><a href="namespaceripple_1_1RPC.html#a577bde9602a28f59e445c496f92a1ccf">ripple::RPC::inject_error</a></div><div class="ttdeci">void inject_error(error_code_i code, JsonValue &json)</div><div class="ttdoc">Add or update the json update to reflect the error code.</div><div class="ttdef"><b>Definition:</b> <a href="ErrorCodes_8h_source.html#l00212">ErrorCodes.h:212</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_1_1RPC_html_a9dc259937a004b30e88f41a95756bee0"><div class="ttname"><a href="namespaceripple_1_1RPC.html#a9dc259937a004b30e88f41a95756bee0">ripple::RPC::accountFromString</a></div><div class="ttdeci">Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)</div><div class="ttdef"><b>Definition:</b> <a href="RPCHelpers_8cpp_source.html#l00086">RPCHelpers.cpp:86</a></div></div>
|
||||
<div class="ttc" id="aclassJson_1_1Value_html"><div class="ttname"><a href="classJson_1_1Value.html">Json::Value</a></div><div class="ttdoc">Represents a JSON value.</div><div class="ttdef"><b>Definition:</b> <a href="json__value_8h_source.html#l00145">json_value.h:145</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1XRPAmount_html"><div class="ttname"><a href="classripple_1_1XRPAmount.html">ripple::XRPAmount</a></div><div class="ttdef"><b>Definition:</b> <a href="XRPAmount_8h_source.html#l00046">XRPAmount.h:46</a></div></div>
|
||||
<!-- start footer part -->
|
||||
|
||||
Reference in New Issue
Block a user