changed cancelAllOrdersByMarket

This commit is contained in:
dd 2021-02-13 17:27:55 -05:00
parent fac8a952a4
commit 0ee0507f9e
1 changed files with 2 additions and 3 deletions

View File

@ -262,12 +262,11 @@ export class MarginAccount {
asks: Orderbook,
owner: Account
): Promise<TransactionSignature[]> {
const marketIndex = mangoGroup.getMarketIndex(market)
if (!this.openOrdersAccounts) {
if (this.openOrdersAccounts == undefined) {
throw new Error("Must load open orders accounts first")
}
const marketIndex = mangoGroup.getMarketIndex(market)
const openOrdersAccount = this.openOrdersAccounts[marketIndex]
if (!openOrdersAccount) { // no open orders for this market
return []