Skip to content

Commit

Permalink
delete recent price from db when delisting (#753)
Browse files Browse the repository at this point in the history
delete recent price from db when delisting
  • Loading branch information
EnderCrypto authored and forcodedancing committed May 19, 2022
1 parent d357054 commit 602a999
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions plugins/dex/store/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,8 @@ func (m mapper) DeleteRecentPrices(ctx sdk.Context, symbol string) {
bz := iter.Value()
prices := m.decodeRecentPrices(bz)
prices.removePair(symbol)
if len(prices.Pair) == 0 {
store.Delete(iter.Key())
} else {
bz = m.cdc.MustMarshalBinaryBare(prices)
store.Set(iter.Key(), bz)
}
bz = m.cdc.MustMarshalBinaryBare(prices)
store.Set(iter.Key(), bz)
}
}

Expand Down

0 comments on commit 602a999

Please sign in to comment.