fix: ensure bonder fees are lower than amount

This commit is contained in:
Anthony Laibe 2023-01-20 10:25:49 +01:00 committed by Anthony Laibe
parent 5ea8906dda
commit b6a33089c8
1 changed files with 4 additions and 0 deletions

View File

@ -555,6 +555,10 @@ func (r *Router) suggestedRoutes(
continue continue
} }
if bonderFees.Cmp(maxAmountIn.ToInt()) >= 0 {
continue
}
gasLimit := uint64(0) gasLimit := uint64(0)
if sendType.isTransfer() { if sendType.isTransfer() {
gasLimit, err = bridge.EstimateGas(network, dest, token, amountIn) gasLimit, err = bridge.EstimateGas(network, dest, token, amountIn)