mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-26 14:05:51 +00:00
Fix load manager buglets.
This commit is contained in:
@@ -152,7 +152,7 @@ bool LoadManager::shouldCutoff(LoadSource& source) const
|
||||
boost::mutex::scoped_lock sl(mLock);
|
||||
int now = upTime();
|
||||
canonicalize(source, now);
|
||||
if (!source.isPrivileged() || (source.mBalance > mDebitLimit))
|
||||
if (source.isPrivileged() || (source.mBalance > mDebitLimit))
|
||||
return false;
|
||||
}
|
||||
logDisconnect(source.getName());
|
||||
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
jvResult["id"] = jvRequest["id"];
|
||||
}
|
||||
|
||||
theApp->getLoadManager().adjust(mLoadSource, 5);
|
||||
theApp->getLoadManager().adjust(mLoadSource, -5);
|
||||
return jvResult;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
jvResult["result"] = mRPCHandler.doCommand(jvRequest, iRole, cost);
|
||||
}
|
||||
|
||||
if (theApp->getLoadManager().adjust(mLoadSource, cost) && theApp->getLoadManager().shouldWarn(mLoadSource))
|
||||
if (theApp->getLoadManager().adjust(mLoadSource, -cost) && theApp->getLoadManager().shouldWarn(mLoadSource))
|
||||
jvResult["warning"] = "load";
|
||||
|
||||
// Currently we will simply unwrap errors returned by the RPC
|
||||
|
||||
Reference in New Issue
Block a user