mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-26 14:05:51 +00:00
Begin to sanitize the fee structure. Implement load scaling.
This commit is contained in:
@@ -5,17 +5,14 @@
|
|||||||
SETUP_LOG();
|
SETUP_LOG();
|
||||||
|
|
||||||
|
|
||||||
void RegularKeySetTransactor::calculateFee()
|
uint64_t RegularKeySetTransactor::calculateBaseFee()
|
||||||
{
|
{
|
||||||
Transactor::calculateFee();
|
|
||||||
|
|
||||||
if ( !(mTxnAccount->getFlags() & lsfPasswordSpent) &&
|
if ( !(mTxnAccount->getFlags() & lsfPasswordSpent) &&
|
||||||
(mSigningPubKey.getAccountID() == mTxnAccountID))
|
(mSigningPubKey.getAccountID() == mTxnAccountID))
|
||||||
{ // flag is armed and they signed with the right account
|
{ // flag is armed and they signed with the right account
|
||||||
|
return 0;
|
||||||
mSourceBalance = mTxnAccount->getFieldAmount(sfBalance);
|
|
||||||
if(mSourceBalance < mFeeDue) mFeeDue = 0;
|
|
||||||
}
|
}
|
||||||
|
return Transactor::calculateBaseFee();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
class RegularKeySetTransactor : public Transactor
|
class RegularKeySetTransactor : public Transactor
|
||||||
{
|
{
|
||||||
void calculateFee();
|
uint64_t calculateBaseFee();
|
||||||
public:
|
public:
|
||||||
RegularKeySetTransactor(const SerializedTransaction& txn,TransactionEngineParams params, TransactionEngine* engine) : Transactor(txn,params,engine) {}
|
RegularKeySetTransactor(const SerializedTransaction& txn,TransactionEngineParams params, TransactionEngine* engine) : Transactor(txn,params,engine) {}
|
||||||
TER checkFee();
|
TER checkFee();
|
||||||
|
|||||||
@@ -42,7 +42,12 @@ Transactor::Transactor(const SerializedTransaction& txn,TransactionEngineParams
|
|||||||
|
|
||||||
void Transactor::calculateFee()
|
void Transactor::calculateFee()
|
||||||
{
|
{
|
||||||
mFeeDue = theConfig.FEE_DEFAULT;
|
mFeeDue = STAmount(mEngine->getLedger()->scaleFeeLoad(calculateBaseFee()));
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64_t Transactor::calculateBaseFee()
|
||||||
|
{
|
||||||
|
return theConfig.FEE_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
TER Transactor::payFee()
|
TER Transactor::payFee()
|
||||||
|
|||||||
@@ -24,7 +24,11 @@ protected:
|
|||||||
TER checkSeq();
|
TER checkSeq();
|
||||||
TER payFee();
|
TER payFee();
|
||||||
|
|
||||||
virtual void calculateFee();
|
void calculateFee();
|
||||||
|
|
||||||
|
// Returns the fee, not scaled for load (Should be in fee units. FIXME)
|
||||||
|
virtual uint64_t calculateBaseFee();
|
||||||
|
|
||||||
virtual TER checkSig();
|
virtual TER checkSig();
|
||||||
virtual TER doApply()=0;
|
virtual TER doApply()=0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user