Don't send full ledgers to non-admins when under load.

This commit is contained in:
JoelKatz
2013-08-19 23:36:26 -07:00
parent 64e729fba6
commit 9aaabaebcd

View File

@@ -1962,6 +1962,13 @@ Json::Value RPCHandler::doLedger (Json::Value params, LoadType* loadType, Applic
| (bTransactions ? LEDGER_JSON_DUMP_TXRP : 0)
| (bAccounts ? LEDGER_JSON_DUMP_STATE : 0);
if ((bFull || bAccounts) && getApp().getFeeTrack().isLoadedLocal() && (mRole != ADMIN))
{
WriteLog (lsDEBUG, Peer) << "Too busy to give full ledger";
return rpcError(rpcTOO_BUSY);
}
Json::Value ret (Json::objectValue);
lpLedger->addJson (ret, iOptions);