-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the fee_amount calculation when drain_val...
...should be negative When we calculate drain_val we use saturating_sub, which means that when the operation is supposed to be negative, we have 0 as a result instead. This means we can't calculate the fee amount as `fee_amount += drain_val`. A possible fix could have been making drain_val signed, but instead I went for a slight refactor of the fee calculation, to make it clearer. Fixes #660
- Loading branch information
1 parent
cbf8464
commit da712c4
Showing
1 changed file
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters