fix: Set correct index for limit in book_offers CLI (#6043)

This change fixes an indexing typo in the `book_offers` CLI processing, and does not affect the HTTPS/WS RPC processing.
This commit is contained in:
Mayukha Vadari
2025-11-20 17:07:28 +05:30
committed by GitHub
parent 6ff495fd9b
commit a3d4be4eaf
2 changed files with 34 additions and 15 deletions

View File

@@ -332,15 +332,31 @@ private:
if (jvParams.size() >= 5)
{
int iLimit = jvParams[5u].asInt();
try
{
int iLimit = jvParams[4u].asInt();
if (iLimit > 0)
jvRequest[jss::limit] = iLimit;
if (iLimit > 0)
jvRequest[jss::limit] = iLimit;
}
catch (std::exception const&)
{
return RPC::invalid_field_error(jss::limit);
}
}
if (jvParams.size() >= 6 && jvParams[5u].asInt())
if (jvParams.size() >= 6)
{
jvRequest[jss::proof] = true;
try
{
int bProof = jvParams[5u].asInt();
if (bProof)
jvRequest[jss::proof] = true;
}
catch (std::exception const&)
{
return RPC::invalid_field_error(jss::proof);
}
}
if (jvParams.size() == 7)