diff --git a/src/cpp/ripple/NetworkOPs.cpp b/src/cpp/ripple/NetworkOPs.cpp index 26a8da1bff..41de7ec1fc 100644 --- a/src/cpp/ripple/NetworkOPs.cpp +++ b/src/cpp/ripple/NetworkOPs.cpp @@ -1060,16 +1060,16 @@ void NetworkOPs::setMode(OperatingMode om) std::vector< std::pair > - NetworkOPs::getAccountTxs(const RippleAddress& account, uint32 minLedger, uint32 maxLedger) + NetworkOPs::getAccountTxs(const RippleAddress& account, uint32 minLedger, uint32 maxLedger, bool bAdmin) { // can be called with no locks std::vector< std::pair > ret; std::string sql = - str(boost::format("SELECT AccountTransactions.LedgerSeq,Status,RawTxn,TxnMeta FROM " + boost::str(boost::format("SELECT AccountTransactions.LedgerSeq,Status,RawTxn,TxnMeta FROM " "AccountTransactions INNER JOIN Transactions ON Transactions.TransID = AccountTransactions.TransID " "WHERE Account = '%s' AND AccountTransactions.LedgerSeq <= '%u' AND AccountTransactions.LedgerSeq >= '%u' " - "ORDER BY AccountTransactions.LedgerSeq,AccountTransactions.TransID DESC LIMIT 200;") - % account.humanAccountID() % maxLedger % minLedger); + "ORDER BY AccountTransactions.LedgerSeq,AccountTransactions.TransID DESC%s;") + % account.humanAccountID() % maxLedger % minLedger % (bAdmin ? "" : " LIMIT 200")); { Database* db = theApp->getTxnDB()->getDB(); @@ -1098,15 +1098,15 @@ std::vector< std::pair > } std::vector NetworkOPs::getAccountTxsB( - const RippleAddress& account, uint32 minLedger, uint32 maxLedger) + const RippleAddress& account, uint32 minLedger, uint32 maxLedger, bool bAdmin) { // can be called with no locks std::vector< txnMetaLedgerType> ret; std::string sql = str(boost::format("SELECT AccountTransactions.LedgerSeq,Status,RawTxn,TxnMeta FROM " "AccountTransactions INNER JOIN Transactions ON Transactions.TransID = AccountTransactions.TransID " "WHERE Account = '%s' AND AccountTransactions.LedgerSeq <= '%u' AND AccountTransactions.LedgerSeq >= '%u' " - "ORDER BY AccountTransactions.LedgerSeq,AccountTransactions.TransID DESC LIMIT 500;") - % account.humanAccountID() % maxLedger % minLedger); + "ORDER BY AccountTransactions.LedgerSeq,AccountTransactions.TransID DESC%s;") + % account.humanAccountID() % maxLedger % minLedger % (bAdmin ? "" : " LIMIT 500")); { Database* db = theApp->getTxnDB()->getDB(); diff --git a/src/cpp/ripple/NetworkOPs.h b/src/cpp/ripple/NetworkOPs.h index 99daf9483d..a7207d7de5 100644 --- a/src/cpp/ripple/NetworkOPs.h +++ b/src/cpp/ripple/NetworkOPs.h @@ -294,11 +294,11 @@ public: // client information retrieval functions std::vector< std::pair > - getAccountTxs(const RippleAddress& account, uint32 minLedger, uint32 maxLedger); + getAccountTxs(const RippleAddress& account, uint32 minLedger, uint32 maxLedger, bool bAdmin); typedef boost::tuple txnMetaLedgerType; std::vector - getAccountTxsB(const RippleAddress& account, uint32 minL, uint32 maxL); + getAccountTxsB(const RippleAddress& account, uint32 minL, uint32 maxL, bool bAdmin); std::vector getLedgerAffectedAccounts(uint32 ledgerSeq); std::vector getLedgerTransactions(uint32 ledgerSeq); diff --git a/src/cpp/ripple/RPCHandler.cpp b/src/cpp/ripple/RPCHandler.cpp index cc0a84f7ee..0f25bddcce 100644 --- a/src/cpp/ripple/RPCHandler.cpp +++ b/src/cpp/ripple/RPCHandler.cpp @@ -1706,7 +1706,8 @@ Json::Value RPCHandler::doAccountTransactions(Json::Value jvRequest, int& cost) if (jvRequest.isMember("binary") && jvRequest["binary"].asBool()) { std::vector txns = - mNetOps->getAccountTxsB(raAccount, minLedger, maxLedger); + mNetOps->getAccountTxsB(raAccount, minLedger, maxLedger, mRole == ADMIN); + for (std::vector::const_iterator it = txns.begin(), end = txns.end(); it != end; ++it) { @@ -1723,7 +1724,7 @@ Json::Value RPCHandler::doAccountTransactions(Json::Value jvRequest, int& cost) } else { - std::vector< std::pair > txns = mNetOps->getAccountTxs(raAccount, minLedger, maxLedger); + std::vector< std::pair > txns = mNetOps->getAccountTxs(raAccount, minLedger, maxLedger, mRole == ADMIN); for (std::vector< std::pair >::iterator it = txns.begin(), end = txns.end(); it != end; ++it) { Json::Value obj(Json::objectValue);