Skip to content

Commit 060b426

Browse files
authored
limit order txn comes first when selling base for quote (#705)
1 parent a92eb0f commit 060b426

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

routes/dao_coin_exchange_with_fees.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1526,6 +1526,9 @@ func (fes *APIServer) HandleMarketOrder(
15261526
feeBaseUnits,
15271527
req.MinFeeRateNanosPerKB,
15281528
nil)
1529+
if err != nil {
1530+
return nil, fmt.Errorf("HandleMarketOrder: Problem creating transaction: %v", err)
1531+
}
15291532
_, _, _, _, err = utxoView.ConnectTransaction(
15301533
txn, txn.Hash(), fes.blockchain.BlockTip().Height,
15311534
fes.blockchain.BlockTip().Header.TstampNanoSecs,
@@ -1991,7 +1994,7 @@ func (fes *APIServer) HandleMarketOrder(
19911994
}
19921995

19931996
// Wrap all of the resulting txns into an atomic
1994-
allTxns := append(transferTxns, orderTxn)
1997+
allTxns := append([]*lib.MsgDeSoTxn{orderTxn}, transferTxns...)
19951998
if tokenWhitelistTxn != nil && !skipWhitelist {
19961999
allTxns = append(allTxns, tokenWhitelistTxn)
19972000
}

0 commit comments

Comments
 (0)