Skip to content

Commit

Permalink
Merge pull request #654 from binance-chain/recoveryerror
Browse files Browse the repository at this point in the history
[R4R]fix can't bring bnbchaind back when there is an order whose symbol is lower case
  • Loading branch information
yutianwu authored Sep 3, 2019
2 parents 52adabd + 56e4b20 commit 7c26b6c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plugins/dex/order/keeper_recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"io"
"sort"
"strings"
"time"

bc "github.com/tendermint/tendermint/blockchain"
Expand Down Expand Up @@ -165,11 +166,12 @@ func (kp *Keeper) LoadOrderBookSnapshot(ctx sdk.Context, latestBlockHeight int64
}
for _, m := range ao.Orders {
orderHolder := m
kp.allOrders[m.Symbol][m.Id] = &orderHolder
symbol := strings.ToUpper(m.Symbol)
kp.allOrders[symbol][m.Id] = &orderHolder
if m.CreatedHeight == height {
kp.roundOrders[m.Symbol] = append(kp.roundOrders[m.Symbol], m.Id)
kp.roundOrders[symbol] = append(kp.roundOrders[symbol], m.Id)
if m.TimeInForce == TimeInForce.IOC {
kp.roundIOCOrders[m.Symbol] = append(kp.roundIOCOrders[m.Symbol], m.Id)
kp.roundIOCOrders[symbol] = append(kp.roundIOCOrders[symbol], m.Id)
}
}
if kp.CollectOrderInfoForPublish {
Expand Down

0 comments on commit 7c26b6c

Please sign in to comment.