fix: bonder fees must be lower than amount

This commit is contained in:
Anthony Laibe 2023-07-04 12:01:09 +02:00 committed by Anthony Laibe
parent 3b0f4ee2c1
commit 1cb1c63e82
1 changed files with 8 additions and 2 deletions

View File

@ -554,8 +554,14 @@ func (r *Router) suggestedRoutes(
continue continue
} }
if bonderFees.Cmp(maxAmountIn.ToInt()) >= 0 { if maxAmountIn.ToInt().Cmp(amountIn) >= 0 {
continue if bonderFees.Cmp(amountIn) >= 0 {
continue
}
} else {
if bonderFees.Cmp(maxAmountIn.ToInt()) >= 0 {
continue
}
} }
gasLimit := uint64(0) gasLimit := uint64(0)