Bugfixes.

This commit is contained in:
JoelKatz
2012-06-09 18:04:44 -07:00
parent e2288acfd1
commit 20499106f0
2 changed files with 10 additions and 2 deletions

View File

@@ -1484,7 +1484,8 @@ Json::Value RPCServer::doAccountTransactions(Json::Value& params)
return JSONRPCError(500, "invalid account");
if (!extractString(param, params, 1))
minLedger = boost::lexical_cast<uint32>(param);
return JSONRPCError(500, "invalid ledger index");
minLedger = boost::lexical_cast<uint32>(param);
if ((params.size() == 3) && extractString(param, params, 2))
maxLedger = boost::lexical_cast<uint32>(param);
@@ -1492,10 +1493,15 @@ Json::Value RPCServer::doAccountTransactions(Json::Value& params)
maxLedger = minLedger;
if ((maxLedger < minLedger) || (minLedger == 0) || (maxLedger == 0))
{
std::cerr << "minL=" << minLedger << ", maxL=" << maxLedger << std::endl;
return JSONRPCError(500, "invalid ledger indexes");
}
#ifndef DEBUG
try
{
#endif
std::vector< std::pair<uint32, uint256> > txns =
mNetOps->getAffectedAccounts(account, minLedger, maxLedger);
Json::Value ret(Json::objectValue);
@@ -1529,11 +1535,13 @@ Json::Value RPCServer::doAccountTransactions(Json::Value& params)
ret["Ledgers"] = ledgers;
return ret;
#ifndef DEBUG
}
catch (...)
{
return JSONRPCError(500, "internal error");
}
#endif
}
// unl_add <domain>|<node_public> [<comment>]