Commit 56a6b283 authored by linj's avatar linj Committed by vipwzw

fix local db

parent edd10bb1
...@@ -13,7 +13,7 @@ import ( ...@@ -13,7 +13,7 @@ import (
// sell limit // sell limit
func genSaveSellKv(sellorder *pty.SellOrder) []*types.KeyValue { func genSaveSellKv(sellorder *pty.SellOrder) []*types.KeyValue {
if sellorder.PriceExec != defaultPriceExec { if sellorder.PriceExec != "" && sellorder.PriceExec != defaultPriceExec {
return nil return nil
} }
status := sellorder.Status status := sellorder.Status
...@@ -58,7 +58,7 @@ func genSellOrderKeyValue(kv []*types.KeyValue, sellorder *pty.SellOrder, status ...@@ -58,7 +58,7 @@ func genSellOrderKeyValue(kv []*types.KeyValue, sellorder *pty.SellOrder, status
// buy market // buy market
func saveBuyMarketOrderKeyValue(kv []*types.KeyValue, receipt *pty.ReceiptBuyBase, status int32, height int64) []*types.KeyValue { func saveBuyMarketOrderKeyValue(kv []*types.KeyValue, receipt *pty.ReceiptBuyBase, status int32, height int64) []*types.KeyValue {
if receipt.PriceExec != defaultPriceExec { if receipt.PriceExec != "" && receipt.PriceExec != defaultPriceExec {
return nil return nil
} }
...@@ -105,7 +105,7 @@ func genBuyMarketOrderKeyValue(kv []*types.KeyValue, receipt *pty.ReceiptBuyBase ...@@ -105,7 +105,7 @@ func genBuyMarketOrderKeyValue(kv []*types.KeyValue, receipt *pty.ReceiptBuyBase
// buy limit // buy limit
func genSaveBuyLimitKv(buyOrder *pty.BuyLimitOrder) []*types.KeyValue { func genSaveBuyLimitKv(buyOrder *pty.BuyLimitOrder) []*types.KeyValue {
if buyOrder.PriceExec != defaultPriceExec { if buyOrder.PriceExec != "" && buyOrder.PriceExec != defaultPriceExec {
return nil return nil
} }
...@@ -151,7 +151,7 @@ func genBuyLimitOrderKeyValue(kv []*types.KeyValue, buyOrder *pty.BuyLimitOrder, ...@@ -151,7 +151,7 @@ func genBuyLimitOrderKeyValue(kv []*types.KeyValue, buyOrder *pty.BuyLimitOrder,
// sell market // sell market
func saveSellMarketOrderKeyValue(kv []*types.KeyValue, receipt *pty.ReceiptSellBase, status int32, height int64) []*types.KeyValue { func saveSellMarketOrderKeyValue(kv []*types.KeyValue, receipt *pty.ReceiptSellBase, status int32, height int64) []*types.KeyValue {
if receipt.PriceExec != defaultPriceExec { if receipt.PriceExec != "" && receipt.PriceExec != defaultPriceExec {
return nil return nil
} }
txhash := []byte(receipt.TxHash) txhash := []byte(receipt.TxHash)
...@@ -161,7 +161,7 @@ func saveSellMarketOrderKeyValue(kv []*types.KeyValue, receipt *pty.ReceiptSellB ...@@ -161,7 +161,7 @@ func saveSellMarketOrderKeyValue(kv []*types.KeyValue, receipt *pty.ReceiptSellB
// delete part // delete part
// sell limit // sell limit
func genDeleteSellKv(sellorder *pty.SellOrder) []*types.KeyValue { func genDeleteSellKv(sellorder *pty.SellOrder) []*types.KeyValue {
if sellorder.PriceExec != defaultPriceExec { if sellorder.PriceExec != "" && sellorder.PriceExec != defaultPriceExec {
return nil return nil
} }
status := sellorder.Status status := sellorder.Status
...@@ -176,7 +176,7 @@ func genDeleteSellKv(sellorder *pty.SellOrder) []*types.KeyValue { ...@@ -176,7 +176,7 @@ func genDeleteSellKv(sellorder *pty.SellOrder) []*types.KeyValue {
// buy market // buy market
func deleteBuyMarketOrderKeyValue(kv []*types.KeyValue, receipt *pty.ReceiptBuyBase, status int32, height int64) []*types.KeyValue { func deleteBuyMarketOrderKeyValue(kv []*types.KeyValue, receipt *pty.ReceiptBuyBase, status int32, height int64) []*types.KeyValue {
if receipt.PriceExec != defaultPriceExec { if receipt.PriceExec != "" && receipt.PriceExec != defaultPriceExec {
return nil return nil
} }
return genBuyMarketOrderKeyValue(kv, receipt, status, height, nil) return genBuyMarketOrderKeyValue(kv, receipt, status, height, nil)
...@@ -184,7 +184,7 @@ func deleteBuyMarketOrderKeyValue(kv []*types.KeyValue, receipt *pty.ReceiptBuyB ...@@ -184,7 +184,7 @@ func deleteBuyMarketOrderKeyValue(kv []*types.KeyValue, receipt *pty.ReceiptBuyB
// buy limit // buy limit
func genDeleteBuyLimitKv(buyOrder *pty.BuyLimitOrder) []*types.KeyValue { func genDeleteBuyLimitKv(buyOrder *pty.BuyLimitOrder) []*types.KeyValue {
if buyOrder.PriceExec != defaultPriceExec { if buyOrder.PriceExec != "" && buyOrder.PriceExec != defaultPriceExec {
return nil return nil
} }
status := buyOrder.Status status := buyOrder.Status
...@@ -199,7 +199,7 @@ func genDeleteBuyLimitKv(buyOrder *pty.BuyLimitOrder) []*types.KeyValue { ...@@ -199,7 +199,7 @@ func genDeleteBuyLimitKv(buyOrder *pty.BuyLimitOrder) []*types.KeyValue {
// sell market // sell market
func deleteSellMarketOrderKeyValue(kv []*types.KeyValue, receipt *pty.ReceiptSellBase, status int32, height int64) []*types.KeyValue { func deleteSellMarketOrderKeyValue(kv []*types.KeyValue, receipt *pty.ReceiptSellBase, status int32, height int64) []*types.KeyValue {
if receipt.PriceExec != defaultPriceExec { if receipt.PriceExec != "" && receipt.PriceExec != defaultPriceExec {
return nil return nil
} }
return genSellMarketOrderKeyValue(kv, receipt, status, height, nil) return genSellMarketOrderKeyValue(kv, receipt, status, height, nil)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment