Skip to content

Commit

Permalink
limit order txn comes first when selling base for quote (#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
lazynina authored Dec 3, 2024
1 parent a92eb0f commit 060b426
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion routes/dao_coin_exchange_with_fees.go
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,9 @@ func (fes *APIServer) HandleMarketOrder(
feeBaseUnits,
req.MinFeeRateNanosPerKB,
nil)
if err != nil {
return nil, fmt.Errorf("HandleMarketOrder: Problem creating transaction: %v", err)
}
_, _, _, _, err = utxoView.ConnectTransaction(
txn, txn.Hash(), fes.blockchain.BlockTip().Height,
fes.blockchain.BlockTip().Header.TstampNanoSecs,
Expand Down Expand Up @@ -1991,7 +1994,7 @@ func (fes *APIServer) HandleMarketOrder(
}

// Wrap all of the resulting txns into an atomic
allTxns := append(transferTxns, orderTxn)
allTxns := append([]*lib.MsgDeSoTxn{orderTxn}, transferTxns...)
if tokenWhitelistTxn != nil && !skipWhitelist {
allTxns = append(allTxns, tokenWhitelistTxn)
}
Expand Down

0 comments on commit 060b426

Please sign in to comment.