X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=application%2Fmov%2Fmov_core.go;h=529f8aba4c0b3e1b561c61a2d7523bd5974def2d;hb=c067f8b50973a5bb84223b670e31443854470098;hp=0d503774bccfda142e7a21bcd68bb23e327f1769;hpb=b2806721ac0839dd8c271e7f9ad68a9ced9048d1;p=bytom%2Fvapor.git diff --git a/application/mov/mov_core.go b/application/mov/mov_core.go index 0d503774..529f8aba 100644 --- a/application/mov/mov_core.go +++ b/application/mov/mov_core.go @@ -80,12 +80,12 @@ func (m *MovCore) BeforeProposalBlock(txs []*types.Tx, nodeProgram []byte, block 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) @@ -291,12 +291,12 @@ func validateMatchedTxFeeAmount(tx *types.Tx) error { @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 @@ -370,7 +370,7 @@ func applyTransactions(txs []*types.Tx) ([]*common.Order, []*common.Order, error /* @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) { @@ -394,7 +394,7 @@ func buildOrderTable(store database.MovStore, txs []*types.Tx) (*match.OrderTabl arrivalDelOrders = append(arrivalDelOrders, delOrders...) } - return match.NewOrderTable(store, arrivalAddOrders, arrivalDelOrders), nil + return match.NewOrderBook(store, arrivalAddOrders, arrivalDelOrders), nil } func calcMatchedTxGasUsed(tx *types.Tx) int64 {