diff --git a/src/ripple/app/tx/impl/XChainBridge.cpp b/src/ripple/app/tx/impl/XChainBridge.cpp index 59450113d2b..be315236f2c 100644 --- a/src/ripple/app/tx/impl/XChainBridge.cpp +++ b/src/ripple/app/tx/impl/XChainBridge.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -41,7 +42,6 @@ #include #include #include - #include #include @@ -672,6 +672,12 @@ finalizeClaimHelper( // if the transfer failed, distribute the pool for "OnTransferFail" // cases (the attesters did their job) STAmount const share = [&] { + auto const round_mode = + innerSb.rules().enabled(fixXChainRewardRounding) + ? Number::rounding_mode::downward + : Number::getround(); + saveNumberRoundMode _{Number::setround(round_mode)}; + STAmount const den{rewardAccounts.size()}; return divide(rewardPool, den, rewardPool.issue()); }(); diff --git a/src/ripple/protocol/Feature.h b/src/ripple/protocol/Feature.h index 2f956e0dcd1..ffe8d0adc6b 100644 --- a/src/ripple/protocol/Feature.h +++ b/src/ripple/protocol/Feature.h @@ -74,7 +74,7 @@ namespace detail { // Feature.cpp. Because it's only used to reserve storage, and determine how // large to make the FeatureBitset, it MAY be larger. It MUST NOT be less than // the actual number of amendments. A LogicError on startup will verify this. -static constexpr std::size_t numFeatures = 69; +static constexpr std::size_t numFeatures = 70; /** Amendments that this server supports and the default voting behavior. Whether they are enabled depends on the Rules defined in the validated @@ -356,6 +356,7 @@ extern uint256 const fixNFTokenReserve; extern uint256 const fixInnerObjTemplate; extern uint256 const featurePriceOracle; extern uint256 const fixEmptyDID; +extern uint256 const fixXChainRewardRounding; } // namespace ripple diff --git a/src/ripple/protocol/impl/Feature.cpp b/src/ripple/protocol/impl/Feature.cpp index 313a34e79ed..f7a8018c393 100644 --- a/src/ripple/protocol/impl/Feature.cpp +++ b/src/ripple/protocol/impl/Feature.cpp @@ -463,6 +463,7 @@ REGISTER_FIX (fixNFTokenReserve, Supported::yes, VoteBehavior::De REGISTER_FIX (fixInnerObjTemplate, Supported::yes, VoteBehavior::DefaultNo); REGISTER_FEATURE(PriceOracle, Supported::yes, VoteBehavior::DefaultNo); REGISTER_FIX (fixEmptyDID, Supported::yes, VoteBehavior::DefaultNo); +REGISTER_FIX (fixXChainRewardRounding, Supported::yes, VoteBehavior::DefaultNo); // The following amendments are obsolete, but must remain supported // because they could potentially get enabled.