mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-01 00:15:51 +00:00
Fix segfault on start.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include "LoadManager.h"
|
||||
|
||||
LoadManager::LoadManager(int creditRate, int creditLimit, int debitWarn, int debitLimit) :
|
||||
mCreditRate(creditRate), mCreditLimit(creditLimit), mDebitWarn(debitWarn), mDebitLimit(debitLimit)
|
||||
mCreditRate(creditRate), mCreditLimit(creditLimit), mDebitWarn(debitWarn), mDebitLimit(debitLimit), mCosts(LT_MAX)
|
||||
{
|
||||
addLoadCost(LoadCost(LT_InvalidRequest, 10, LC_CPU | LC_Network));
|
||||
addLoadCost(LoadCost(LT_RequestNoReply, 1, LC_CPU | LC_Disk));
|
||||
|
||||
@@ -25,6 +25,8 @@ enum LoadType
|
||||
// Requests
|
||||
LT_RequestData, // A request that is hard to satisfy, disk access
|
||||
LT_CheapQuery, // A query that is trivial, cached data
|
||||
|
||||
LT_MAX = LT_CheapQuery
|
||||
};
|
||||
|
||||
// load categoryies
|
||||
@@ -39,6 +41,7 @@ public:
|
||||
int mCost;
|
||||
int mCategories;
|
||||
|
||||
LoadCost() : mType(), mCost(0), mCategories(0) { ; }
|
||||
LoadCost(LoadType t, int cost, int cat) : mType(t), mCost(cost), mCategories(cat) { ; }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user