Skip to content

Commit

Permalink
fix typo in trade-validation code that results into panic
Browse files Browse the repository at this point in the history
  • Loading branch information
norwnd committed Dec 30, 2024
1 parent 2f6ad34 commit 9be987e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -6203,8 +6203,8 @@ func (c *Core) validateTradeRate(sell bool, rate uint64, market string, dc *dexC
return newError(walletErr, fmt.Sprintf("(1-time warning, retry to proceed) couldn't "+
"fetch best buy order in Bison book: %v", err))
}
bestBisonBuyRate := bisonOrders[0].Rate
if sell && found {
bestBisonBuyRate := bisonOrders[0].Rate
if rate <= bestBisonBuyRate {
return newError(orderParamsErr, fmt.Sprintf("(1-time warning, retry to proceed) "+
"trying to place trade with rate %d "+
Expand All @@ -6221,8 +6221,8 @@ func (c *Core) validateTradeRate(sell bool, rate uint64, market string, dc *dexC
return newError(walletErr, fmt.Sprintf("(1-time warning, retry to proceed) couldn't "+
"fetch best sell order in Bison book: %v", err))
}
bestBisonSellRate := bisonOrders[0].Rate
if !sell && found {
bestBisonSellRate := bisonOrders[0].Rate
if rate >= bestBisonSellRate {
return newError(orderParamsErr, fmt.Sprintf("(1-time warning, retry to proceed) "+
"trying to place trade with rate %d "+
Expand Down

0 comments on commit 9be987e

Please sign in to comment.