mirror of
https://github.com/XRPLF/rippled.git
synced 2026-10-03 10:18:26 +00:00
XRPFees: Fee setting and handling improvements (#4247)
* Introduces amendment `XRPFees` * Convert fee voting and protocol messages to use XRPAmounts * Includes Validations, Change transactions, the "Fees" ledger object, and subscription messages * Improve handling of 0 drop reference fee with TxQ. For use with networks that do not want to require fees * Note that fee escalation logic is still in place, which may cause the open ledger fee to rise if the network is busy. 0 drop transactions will still queue, and fee escalation can be effectively disabled by modifying the configuration on all nodes * Change default network reserves to match Mainnet * Name the new SFields *Drops (not *XRP) * Reserve SField IDs for Hooks * Clarify comments explaining the ttFEE transaction field validation
This commit is contained in:
@@ -720,8 +720,7 @@ checkFee(
|
||||
}
|
||||
}
|
||||
|
||||
// Default fee in fee units.
|
||||
FeeUnit32 const feeDefault = config.TRANSACTION_FEE_BASE;
|
||||
XRPAmount const feeDefault = config.FEE_DEFAULT;
|
||||
|
||||
auto ledger = app.openLedger().current();
|
||||
// Administrative and identified endpoints are exempt from local fees.
|
||||
@@ -738,11 +737,7 @@ checkFee(
|
||||
|
||||
auto const limit = [&]() {
|
||||
// Scale fee units to drops:
|
||||
auto const drops =
|
||||
mulDiv(feeDefault, ledger->fees().base, ledger->fees().units);
|
||||
if (!drops.first)
|
||||
Throw<std::overflow_error>("mulDiv");
|
||||
auto const result = mulDiv(drops.second, mult, div);
|
||||
auto const result = mulDiv(feeDefault, mult, div);
|
||||
if (!result.first)
|
||||
Throw<std::overflow_error>("mulDiv");
|
||||
return result.second;
|
||||
|
||||
Reference in New Issue
Block a user