lnrpc: fix the existing routing fee inaccuracy

When updating the channel routing policy, we encounter an inaccurate
precision error when calculating the routing fee. The issue stems from
the way the IEEE 754 standard works.

The solution here is to add a uint64 parameter (as mentioned in the
issue) and keep the float64 fee_rate parameter but rounding the product
of the base and fee rate.
This commit is contained in:
ErikEk authored and Olaoluwa Osuntokun committed 2022-01-25 15:42:57 -08:00
1 parent 234fdc6c9c
commit ef1eff1058
6 files changed
+837 -770

No files matched your search

+3
View File
@@ -3751,6 +3751,9 @@ message PolicyUpdateRequest {
// goes up to 6 decimal places, so 1e-6.
double fee_rate = 4;
// The effective fee rate in micro-satoshis (parts per million).
uint32 fee_rate_ppm = 9;
// The required timelock delta for HTLCs forwarded over the channel.
uint32 time_lock_delta = 5;