Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit d65d2d6

Browse files
committed
check 0 value of float version of amount string in batchedExchange
1 parent 95503d9 commit d65d2d6

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

plugins/batchedExchange.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,12 @@ func op2CommandsHack(
467467
return nil, fmt.Errorf("error converting from manageOffer op to Order: %s", e)
468468
}
469469

470-
if manageOffer.Amount == "0" {
470+
amtFloat, e := strconv.ParseFloat(manageOffer.Amount, 64)
471+
if e != nil {
472+
return nil, fmt.Errorf("error parsing offer amount (%s): %s", manageOffer.Amount, e)
473+
}
474+
475+
if amtFloat == 0 {
471476
// cancel
472477
// fetch real orderID here (hoops we have to jump through because of the hacked approach to using centralized exchanges)
473478
var orderID string

0 commit comments

Comments
 (0)