57 | @@ -58,7 +58,7 @@ def small_txpuzzle_randfee(from_node, conflist, unconflist, amount, min_fee, fee
58 | # It's best to exponentially distribute our random fees
59 | # because the buckets are exponentially spaced.
60 | # Exponentially distributed from 1-128 * fee_increment
61 | - rand_fee = float(fee_increment) * (1.1892 ** random.randint(0, 28))
62 | + rand_fee = fee_increment * Decimal(1.1892 ** random.randint(0, 28))
Not sure if rejecting a float is the right thing to do when the caller just wraps the float into a Decimal.
This is an exception: random fee generation. Rounding is not an
important issue.
The corresponding rule: argument will be a well determined monetary
quantity, for repeatability purposes. Any other case, that is correctly
already not using float.