From 9767d6f324a4b656628fa65c95356e7b20fc1c81 Mon Sep 17 00:00:00 2001 From: Erheng Lu Date: Tue, 30 Jun 2020 20:22:30 +0800 Subject: [PATCH] fix lastMatchHeight recover issue --- plugins/dex/order/keeper_recovery.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/dex/order/keeper_recovery.go b/plugins/dex/order/keeper_recovery.go index 860e6dc82..328522928 100644 --- a/plugins/dex/order/keeper_recovery.go +++ b/plugins/dex/order/keeper_recovery.go @@ -23,7 +23,9 @@ import ( bnclog "github.com/binance-chain/node/common/log" "github.com/binance-chain/node/common/upgrade" "github.com/binance-chain/node/common/utils" + "github.com/binance-chain/node/plugins/dex/list" me "github.com/binance-chain/node/plugins/dex/matcheng" + dexutils "github.com/binance-chain/node/plugins/dex/utils" "github.com/binance-chain/node/wire" ) @@ -241,6 +243,10 @@ func (kp *DexKeeper) replayOneBlocks(logger log.Logger, block *tmtypes.Block, st logger.Error("Failed to replay cancel msg", "err", err) } logger.Info("Canceled Order", "order", msg) + case list.ListMiniMsg: + kp.engines[dexutils.Assets2TradingPair(msg.BaseAssetSymbol,msg.QuoteAssetSymbol)].LastMatchHeight = 0 + case list.ListMsg: + kp.engines[dexutils.Assets2TradingPair(msg.BaseAssetSymbol,msg.QuoteAssetSymbol)].LastMatchHeight = 0 } } }