OSDN Git Service
(root)
/
bytom
/
vapor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix mov issue (#462)
[bytom/vapor.git]
/
application
/
mov
/
mov_core.go
diff --git
a/application/mov/mov_core.go
b/application/mov/mov_core.go
index
0d50377
..
529f8ab
100644
(file)
--- 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
}
return nil, nil
}
- order
Table, err := buildOrderTable
(m.movStore, txs)
+ order
Book, err := buildOrderBook
(m.movStore, txs)
if err != nil {
return nil, err
}
if err != nil {
return nil, err
}
- matchEngine := match.NewEngine(order
Table
, maxFeeRate, nodeProgram)
+ matchEngine := match.NewEngine(order
Book
, maxFeeRate, nodeProgram)
tradePairMap := make(map[string]bool)
tradePairIterator := database.NewTradePairIterator(m.movStore)
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 {
@issue: the match package didn't support circle yet
*/
func (m *MovCore) validateMatchedTxSequence(txs []*types.Tx) error {
- order
Table, err := buildOrderTable
(m.movStore, txs)
+ order
Book, err := buildOrderBook
(m.movStore, txs)
if err != nil {
return err
}
if err != nil {
return err
}
- matchEngine := match.NewEngine(order
Table
, maxFeeRate, nil)
+ matchEngine := match.NewEngine(order
Book
, maxFeeRate, nil)
for _, matchedTx := range txs {
if !common.IsMatchedTx(matchedTx) {
continue
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
*/
/*
@issue: if consensus node packed match transaction first then packed regular tx, this function's logic may make a valid block invalid
*/
-func buildOrder
Table(store database.MovStore, txs []*types.Tx) (*match.OrderTable
, error) {
+func buildOrder
Book(store database.MovStore, txs []*types.Tx) (*match.OrderBook
, error) {
var nonMatchedTxs []*types.Tx
for _, tx := range txs {
if !common.IsMatchedTx(tx) {
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...)
}
arrivalDelOrders = append(arrivalDelOrders, delOrders...)
}
- return match.NewOrder
Table
(store, arrivalAddOrders, arrivalDelOrders), nil
+ return match.NewOrder
Book
(store, arrivalAddOrders, arrivalDelOrders), nil
}
func calcMatchedTxGasUsed(tx *types.Tx) int64 {
}
func calcMatchedTxGasUsed(tx *types.Tx) int64 {