eclair icon indicating copy to clipboard operation
eclair copied to clipboard

Fix blinded path amount to forward calculation

Open t-bast opened this issue 3 years ago • 0 comments

Apply @rustyrussell's neat truncating integer arithmetic formula to calculate the amount that should be forwarded by blinded path nodes instead of our previous approximation.

This simply expands ceil(a/b) as (a+b-1)/b and provides better results in practice (I ran a simulation with many values for fees and amount).

t-bast avatar Aug 08 '22 11:08 t-bast