Ensure account_tx queries over and returns correct range

This commit is contained in:
JoelKatz
2015-01-16 14:02:59 -08:00
committed by Vinnie Falco
parent abc4fb81b1
commit 676293ec42

View File

@@ -69,8 +69,10 @@ Json::Value doAccountTx (RPC::Context& context)
std::int64_t iLedgerMax = params.isMember ("ledger_index_max")
? params["ledger_index_max"].asInt () : -1;
uLedgerMin = iLedgerMin == -1 ? uValidatedMin : iLedgerMin;
uLedgerMax = iLedgerMax == -1 ? uValidatedMax : iLedgerMax;
uLedgerMin = iLedgerMin == -1 ? uValidatedMin :
((iLedgerMin >= uValidatedMin) ? iLedgerMin : uValidatedMin);
uLedgerMax = iLedgerMax == -1 ? uValidatedMax :
((iLedgerMax <= uValidatedMax) ? iLedgerMax : uValidatedMax);
if (uLedgerMax < uLedgerMin)
return rpcError (rpcLGR_IDXS_INVALID);