mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-28 23:15:52 +00:00
Track cluster load and local load separately.
This commit is contained in:
@@ -43,9 +43,12 @@ public:
|
||||
|
||||
virtual Json::Value getJson (uint64 baseFee, uint32 referenceFeeUnits) = 0;
|
||||
|
||||
virtual void setClusterFee (uint32) = 0;
|
||||
virtual uint32 getClusterFee () = 0;
|
||||
virtual bool raiseLocalFee () = 0;
|
||||
virtual bool lowerLocalFee () = 0;
|
||||
virtual bool isLoaded () = 0;
|
||||
virtual bool isLoadedLocal () = 0;
|
||||
virtual bool isLoadedCluster () = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -80,7 +80,19 @@ public:
|
||||
return std::max (mLocalTxnLoadFee, mRemoteTxnLoadFee);
|
||||
}
|
||||
|
||||
bool isLoaded ()
|
||||
void setClusterFee (uint32 fee)
|
||||
{
|
||||
boost::mutex::scoped_lock sl (mLock);
|
||||
mClusterTxnLoadFee = fee;
|
||||
}
|
||||
|
||||
uint32 getClusterFee ()
|
||||
{
|
||||
boost::mutex::scoped_lock sl (mLock);
|
||||
return mClusterTxnLoadFee;
|
||||
}
|
||||
|
||||
bool isLoadedLocal ()
|
||||
{
|
||||
// VFALCO TODO This could be replaced with a SharedData and
|
||||
// using a read/write lock instead of a critical section.
|
||||
@@ -92,6 +104,18 @@ public:
|
||||
return (raiseCount != 0) || (mLocalTxnLoadFee != lftNormalFee);
|
||||
}
|
||||
|
||||
bool isLoadedCluster ()
|
||||
{
|
||||
// VFALCO TODO This could be replaced with a SharedData and
|
||||
// using a read/write lock instead of a critical section.
|
||||
//
|
||||
// NOTE This applies to all the locking in this class.
|
||||
//
|
||||
//
|
||||
boost::mutex::scoped_lock sl (mLock);
|
||||
return (raiseCount != 0) || (mLocalTxnLoadFee != lftNormalFee) || (mClusterTxnLoadFee != lftNormalFee);
|
||||
}
|
||||
|
||||
void setRemoteFee (uint32 f)
|
||||
{
|
||||
boost::mutex::scoped_lock sl (mLock);
|
||||
@@ -181,6 +205,7 @@ private:
|
||||
|
||||
uint32 mLocalTxnLoadFee; // Scale factor, lftNormalFee = normal fee
|
||||
uint32 mRemoteTxnLoadFee; // Scale factor, lftNormalFee = normal fee
|
||||
uint32 mClusterTxnLoadFee; // Scale factor, lftNormalFee = normal fee
|
||||
int raiseCount;
|
||||
|
||||
boost::mutex mLock;
|
||||
|
||||
Reference in New Issue
Block a user