mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Disable retrieving full state trees for non-admins.
This commit is contained in:
committed by
Nik Bougalis
parent
16d2bbd6e5
commit
b1fea3c51e
@@ -2302,8 +2302,16 @@ Json::Value RPCHandler::doLedger (Json::Value params, Resource::Charge& loadType
|
||||
| (bTransactions ? LEDGER_JSON_DUMP_TXRP : 0)
|
||||
| (bAccounts ? LEDGER_JSON_DUMP_STATE : 0);
|
||||
|
||||
if (bFull || bAccounts | bExpand)
|
||||
if (bFull || bAccounts)
|
||||
{
|
||||
|
||||
if (mRole != Config::ADMIN)
|
||||
{
|
||||
// Until some sane way to get full ledgers has been implemented, disallow
|
||||
// retrieving all state nodes
|
||||
return rpcError (rpcNO_PERMISSION);
|
||||
}
|
||||
|
||||
if (getApp().getFeeTrack().isLoadedLocal() && (mRole != Config::ADMIN))
|
||||
{
|
||||
WriteLog (lsDEBUG, Peer) << "Too busy to give full ledger";
|
||||
|
||||
Reference in New Issue
Block a user