diff --git a/src/NetworkOPs.cpp b/src/NetworkOPs.cpp index 0e7c6c5ff2..d2e93f926f 100644 --- a/src/NetworkOPs.cpp +++ b/src/NetworkOPs.cpp @@ -539,7 +539,7 @@ std::vector< std::pair > std::string sql = str(boost::format("SELECT LedgerSeq,TransID FROM AccountTransactions INDEXED BY AcctTxIndex " - " WHERE Account = % AND LedgerSeq <= % AND LedgerSeq >= % ORDER BY LedgerSeq LIMIT 1000") + " WHERE Account = %s AND LedgerSeq <= %d AND LedgerSeq >= %d ORDER BY LedgerSeq LIMIT 1000") % account.humanAccountID() % minLedger % maxLedger); Database *db = theApp->getAcctTxnDB()->getDB(); diff --git a/src/RPCServer.cpp b/src/RPCServer.cpp index 49812e0e72..d674254985 100644 --- a/src/RPCServer.cpp +++ b/src/RPCServer.cpp @@ -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(param); + return JSONRPCError(500, "invalid ledger index"); + minLedger = boost::lexical_cast(param); if ((params.size() == 3) && extractString(param, params, 2)) maxLedger = boost::lexical_cast(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 > 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 | []