return nil, nil
}
- orderTable, err := buildOrderTable(m.movStore, txs)
+ orderBook, err := buildOrderBook(m.movStore, txs)
if err != nil {
return nil, err
}
- matchEngine := match.NewEngine(orderTable, maxFeeRate, nodeProgram)
+ matchEngine := match.NewEngine(orderBook, maxFeeRate, nodeProgram)
tradePairMap := make(map[string]bool)
tradePairIterator := database.NewTradePairIterator(m.movStore)
@issue: the match package didn't support circle yet
*/
func (m *MovCore) validateMatchedTxSequence(txs []*types.Tx) error {
- orderTable, err := buildOrderTable(m.movStore, txs)
+ orderBook, err := buildOrderBook(m.movStore, txs)
if err != nil {
return err
}
- matchEngine := match.NewEngine(orderTable, maxFeeRate, nil)
+ matchEngine := match.NewEngine(orderBook, maxFeeRate, nil)
for _, matchedTx := range txs {
if !common.IsMatchedTx(matchedTx) {
continue
/*
@issue: if consensus node packed match transaction first then packed regular tx, this function's logic may make a valid block invalid
*/
-func buildOrderTable(store database.MovStore, txs []*types.Tx) (*match.OrderTable, error) {
+func buildOrderBook(store database.MovStore, txs []*types.Tx) (*match.OrderBook, error) {
var nonMatchedTxs []*types.Tx
for _, tx := range txs {
if !common.IsMatchedTx(tx) {
arrivalDelOrders = append(arrivalDelOrders, delOrders...)
}
- return match.NewOrderTable(store, arrivalAddOrders, arrivalDelOrders), nil
+ return match.NewOrderBook(store, arrivalAddOrders, arrivalDelOrders), nil
}
func calcMatchedTxGasUsed(tx *types.Tx) int64 {