• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: 提交

Golang implemented sidechain for Bytom


Commit MetaInfo

修订版28941b0c64dd2ff2cab3d35f3b308a9977ae8ef9 (tree)
时间2019-11-05 15:19:01
作者shenao78 <shenao.78@163....>
Commitershenao78

Log Message

opt code

更改概述

差异

--- a/application/mov/match/match.go
+++ b/application/mov/match/match.go
@@ -42,20 +42,11 @@ func (e *Engine) HasMatchedTx(tradePairs ...*common.TradePair) bool {
4242 // the size of trade pairs at least 2, and the sequence of trade pairs can form a loop
4343 // for example, [assetA -> assetB, assetB -> assetC, assetC -> assetA]
4444 func (e *Engine) NextMatchedTx(tradePairs ...*common.TradePair) (*types.Tx, error) {
45- if err := validateTradePairs(tradePairs); err != nil {
46- return nil, err
47- }
48-
49- orders := e.peekOrders(tradePairs)
50- if len(orders) == 0 {
51- return nil, errors.New("no order for the specified trade pair in the order table")
52- }
53-
54- if !isMatched(orders) {
45+ if !e.HasMatchedTx(tradePairs...) {
5546 return nil, errors.New("the specified trade pairs can not be matched")
5647 }
5748
58- tx, err := e.buildMatchTx(orders)
49+ tx, err := e.buildMatchTx(e.peekOrders(tradePairs))
5950 if err != nil {
6051 return nil, err
6152 }
Show on old repository browser