mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Tie the peer code into the new load management code.
This commit is contained in:
@@ -101,6 +101,12 @@ bool LoadManager::shouldCutoff(LoadSource& source) const
|
||||
return !source.isPrivileged() && (source.mBalance < mDebitLimit);
|
||||
}
|
||||
|
||||
bool LoadManager::adjust(LoadSource& source, LoadType t) const
|
||||
{ // FIXME: Scale by category
|
||||
LoadCost cost = mCosts[static_cast<int>(t)];
|
||||
return adjust(source, cost.mCost);
|
||||
}
|
||||
|
||||
bool LoadManager::adjust(LoadSource& source, int credits) const
|
||||
{ // return: true = need to warn/cutoff
|
||||
time_t now = time(NULL);
|
||||
|
||||
Reference in New Issue
Block a user