mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Require empty string for empty peer account on account_lines:
A recent commit (0d0227e744a81746714dee71c4c2c63d41e3e691) broke the
parser for the rpc command `account_lines` such that an empty
string ("") was no longer required for the second parameter. This commit
fixes that bug.
Note the empty peer field string requirement only applies to the rippled
command line. It can be comitted with a ledger via HTTP or WebSocket.
This commit is contained in:
@@ -580,7 +580,7 @@ private:
|
||||
// account_lines <account> <account>|"" [<ledger>]
|
||||
Json::Value parseAccountLines (Json::Value const& jvParams)
|
||||
{
|
||||
return parseAccountRaw2 (jvParams, "peer");
|
||||
return parseAccountRaw2 (jvParams, jss::peer);
|
||||
}
|
||||
|
||||
// account_channels <account> <account>|"" [<ledger>]
|
||||
@@ -658,27 +658,32 @@ private:
|
||||
Json::Value jvRequest (Json::objectValue);
|
||||
for (auto i = 0; i < nParams; ++i)
|
||||
{
|
||||
std::string const strParam = jvParams[i].asString ();
|
||||
std::string strParam = jvParams[i].asString ();
|
||||
|
||||
// Parameters 0 and 1 may be accounts
|
||||
if ((i < 2) && (parseBase58<PublicKey> (
|
||||
TokenType::TOKEN_ACCOUNT_PUBLIC, strParam) ||
|
||||
parseBase58<AccountID> (strParam) ||
|
||||
parseGenericSeed (strParam)))
|
||||
{
|
||||
jvRequest[accFields[i]] = strParam;
|
||||
if (i==1 && strParam.empty())
|
||||
continue;
|
||||
}
|
||||
|
||||
// Parameters 1 and 2 may be ledgers, but only if it's the last param
|
||||
if (i > 0 && i == nParams - 1)
|
||||
// Parameters 0 and 1 are accounts
|
||||
if (i < 2)
|
||||
{
|
||||
if (parseBase58<PublicKey> (
|
||||
TokenType::TOKEN_ACCOUNT_PUBLIC, strParam) ||
|
||||
parseBase58<AccountID> (strParam) ||
|
||||
parseGenericSeed (strParam))
|
||||
{
|
||||
jvRequest[accFields[i]] = std::move (strParam);
|
||||
}
|
||||
else
|
||||
{
|
||||
return rpcError (rpcACT_MALFORMED);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (jvParseLedger (jvRequest, strParam))
|
||||
return jvRequest;
|
||||
}
|
||||
if (i == 3)
|
||||
return rpcError (rpcLGR_IDX_MALFORMED);
|
||||
return rpcError (rpcACT_MALFORMED);
|
||||
}
|
||||
}
|
||||
|
||||
return jvRequest;
|
||||
|
||||
Reference in New Issue
Block a user