OSDN Git Service

update comment
authorshenao78 <shenao.78@163.com>
Tue, 22 Oct 2019 10:27:00 +0000 (18:27 +0800)
committershenao78 <shenao.78@163.com>
Tue, 22 Oct 2019 10:27:00 +0000 (18:27 +0800)
application/mov/match/match.go

index d2ca96c..5e7c969 100644 (file)
@@ -27,8 +27,9 @@ func NewEngine(movStore database.MovStore, nodeProgram []byte) *Engine {
        return &Engine{orderTable: NewOrderTable(movStore), nodeProgram: nodeProgram}
 }
 
-// NextMatchedTx match two opposite pending orders.
-// for example, the buy orders want change A with B, then the sell orders must change B with A.
+// NextMatchedTx return the next matchable transaction by the specified trade pairs
+// the size of trade pairs at least, and the sequence of trade pairs can form a loop
+// for example, [assetA -> assetB, assetB -> assetC, assetC -> assetA]
 func (e *Engine) NextMatchedTx(tradePairs  ...*common.TradePair) (*types.Tx, error) {
        if err := validateTradePairs(tradePairs); err != nil {
                return nil, err