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,9 +554,15 @@ func (r *Router) suggestedRoutes(
continue continue
} }
if maxAmountIn.ToInt().Cmp(amountIn) >= 0 {
if bonderFees.Cmp(amountIn) >= 0 {
continue
}
} else {
if bonderFees.Cmp(maxAmountIn.ToInt()) >= 0 { if bonderFees.Cmp(maxAmountIn.ToInt()) >= 0 {
continue continue
} }
}
gasLimit := uint64(0) gasLimit := uint64(0)
if sendType.isTransfer() { if sendType.isTransfer() {