FeeFrac::EvaluateFee

Compute the fee for a given size at_size using this object's feerate.

Synopsis

Declared in <util/feefrac.h>

template<bool RoundDown>
int64_t
EvaluateFee(int32_t at_size) const noexcept;

Description

This effectively corresponds to evaluating (this->fee * at_size) / this->size, with the result rounded towards negative infinity (if RoundDown) or towards positive infinity (if !RoundDown).

Requires this->size > 0, at_size >= 0, and that the correct result fits in a int64_t. This is guaranteed to be the case when 0 <= at_size <= this->size.

Return Value

The fee corresponding to at_size at this object's feerate.

Parameters

NameDescription
at_sizeThe size to evaluate the fee at.