xrpld
Loading...
Searching...
No Matches
xrpl::LoadFeeTrack Class Referencefinal

Manages the current fee schedule. More...

#include <LoadFeeTrack.h>

Collaboration diagram for xrpl::LoadFeeTrack:

Public Member Functions

 LoadFeeTrack (beast::Journal journal=beast::Journal(beast::Journal::getNullSink()))
 ~LoadFeeTrack ()=default
void setRemoteFee (std::uint32_t f)
std::uint32_t getRemoteFee () const
std::uint32_t getLocalFee () const
std::uint32_t getClusterFee () const
std::uint32_t getLoadFactor () const
std::pair< std::uint32_t, std::uint32_tgetScalingFactors () const
void setClusterFee (std::uint32_t fee)
bool raiseLocalFee ()
bool lowerLocalFee ()
bool isLoadedLocal () const
bool isLoadedCluster () const

Static Public Member Functions

static std::uint32_t getLoadBase ()

Private Attributes

beast::Journal const j_
std::mutex lock_
std::uint32_t localTxnLoadFee_ {kLftNormalFee}
std::uint32_t remoteTxnLoadFee_ {kLftNormalFee}
std::uint32_t clusterTxnLoadFee_ {kLftNormalFee}
std::uint32_t raiseCount_ {0}

Static Private Attributes

static constexpr std::uint32_t kLftNormalFee = 256
static constexpr std::uint32_t kLftFeeIncFraction = 4
static constexpr std::uint32_t kLftFeeDecFraction = 4
static constexpr std::uint32_t kLftFeeMax = kLftNormalFee * 1000000

Detailed Description

Manages the current fee schedule.

The "base" fee is the cost to send a reference transaction under no load, expressed in millionths of one XRP.

The "load" fee is how much the local server currently charges to send a reference transaction. This fee fluctuates based on the load of the server.

Definition at line 24 of file LoadFeeTrack.h.

Constructor & Destructor Documentation

◆ LoadFeeTrack()

xrpl::LoadFeeTrack::LoadFeeTrack ( beast::Journal journal = beast::Journal(beast::Journal::getNullSink()))
explicit

Definition at line 27 of file LoadFeeTrack.h.

◆ ~LoadFeeTrack()

xrpl::LoadFeeTrack::~LoadFeeTrack ( )
default

Member Function Documentation

◆ setRemoteFee()

void xrpl::LoadFeeTrack::setRemoteFee ( std::uint32_t f)

Definition at line 35 of file LoadFeeTrack.h.

◆ getRemoteFee()

std::uint32_t xrpl::LoadFeeTrack::getRemoteFee ( ) const

Definition at line 43 of file LoadFeeTrack.h.

◆ getLocalFee()

std::uint32_t xrpl::LoadFeeTrack::getLocalFee ( ) const

Definition at line 50 of file LoadFeeTrack.h.

◆ getClusterFee()

std::uint32_t xrpl::LoadFeeTrack::getClusterFee ( ) const

Definition at line 57 of file LoadFeeTrack.h.

◆ getLoadBase()

std::uint32_t xrpl::LoadFeeTrack::getLoadBase ( )
static

Definition at line 64 of file LoadFeeTrack.h.

◆ getLoadFactor()

std::uint32_t xrpl::LoadFeeTrack::getLoadFactor ( ) const

Definition at line 70 of file LoadFeeTrack.h.

◆ getScalingFactors()

std::pair< std::uint32_t, std::uint32_t > xrpl::LoadFeeTrack::getScalingFactors ( ) const

Definition at line 77 of file LoadFeeTrack.h.

◆ setClusterFee()

void xrpl::LoadFeeTrack::setClusterFee ( std::uint32_t fee)

Definition at line 87 of file LoadFeeTrack.h.

◆ raiseLocalFee()

bool xrpl::LoadFeeTrack::raiseLocalFee ( )

Definition at line 17 of file LoadFeeTrack.cpp.

◆ lowerLocalFee()

bool xrpl::LoadFeeTrack::lowerLocalFee ( )

Definition at line 42 of file LoadFeeTrack.cpp.

◆ isLoadedLocal()

bool xrpl::LoadFeeTrack::isLoadedLocal ( ) const

Definition at line 100 of file LoadFeeTrack.h.

◆ isLoadedCluster()

bool xrpl::LoadFeeTrack::isLoadedCluster ( ) const

Definition at line 107 of file LoadFeeTrack.h.

Member Data Documentation

◆ kLftNormalFee

std::uint32_t xrpl::LoadFeeTrack::kLftNormalFee = 256
staticconstexprprivate

Definition at line 115 of file LoadFeeTrack.h.

◆ kLftFeeIncFraction

std::uint32_t xrpl::LoadFeeTrack::kLftFeeIncFraction = 4
staticconstexprprivate

Definition at line 116 of file LoadFeeTrack.h.

◆ kLftFeeDecFraction

std::uint32_t xrpl::LoadFeeTrack::kLftFeeDecFraction = 4
staticconstexprprivate

Definition at line 117 of file LoadFeeTrack.h.

◆ kLftFeeMax

std::uint32_t xrpl::LoadFeeTrack::kLftFeeMax = kLftNormalFee * 1000000
staticconstexprprivate

Definition at line 118 of file LoadFeeTrack.h.

◆ j_

beast::Journal const xrpl::LoadFeeTrack::j_
private

Definition at line 120 of file LoadFeeTrack.h.

◆ lock_

std::mutex xrpl::LoadFeeTrack::lock_
mutableprivate

Definition at line 121 of file LoadFeeTrack.h.

◆ localTxnLoadFee_

std::uint32_t xrpl::LoadFeeTrack::localTxnLoadFee_ {kLftNormalFee}
private

Definition at line 123 of file LoadFeeTrack.h.

◆ remoteTxnLoadFee_

std::uint32_t xrpl::LoadFeeTrack::remoteTxnLoadFee_ {kLftNormalFee}
private

Definition at line 124 of file LoadFeeTrack.h.

◆ clusterTxnLoadFee_

std::uint32_t xrpl::LoadFeeTrack::clusterTxnLoadFee_ {kLftNormalFee}
private

Definition at line 125 of file LoadFeeTrack.h.

◆ raiseCount_

std::uint32_t xrpl::LoadFeeTrack::raiseCount_ {0}
private

Definition at line 126 of file LoadFeeTrack.h.