From d4b7aad835aded87c6ef222e7d7ca6ebfed97288 Mon Sep 17 00:00:00 2001 From: Philemon Ukane Date: Tue, 19 Nov 2024 23:03:46 +0100 Subject: [PATCH] Use core.Active to check or active order Signed-off-by: Philemon Ukane --- libwallet/dex_interface.go | 2 +- ui/window.go | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/libwallet/dex_interface.go b/libwallet/dex_interface.go index 0e838a411..a5432909d 100644 --- a/libwallet/dex_interface.go +++ b/libwallet/dex_interface.go @@ -30,7 +30,7 @@ type DEXClient interface { ExportSeed(pw []byte) (string, error) SyncBook(dex string, base, quote uint32) (*orderbook.OrderBook, core.BookFeed, error) Orders(filter *core.OrderFilter) ([]*core.Order, error) - ActiveOrders() (map[string][]*core.Order, map[string][]*core.InFlightOrder, error) + Active() bool Trade(pw []byte, form *core.TradeForm) (*core.Order, error) // TradeAsync is like Trade but a temporary order is returned before order // server validation. This helps handle some issues related to UI/UX where diff --git a/ui/window.go b/ui/window.go index 3361da465..04aab7ce7 100644 --- a/ui/window.go +++ b/ui/window.go @@ -198,13 +198,7 @@ func (win *Window) HandleEvents() { return } - ord, inflight, err := win.load.AssetsManager.DexClient().ActiveOrders() - if err != nil { - log.Errorf("AssetsManager.DexClient().ActiveOrders error: %v", err) - return - } - - if len(ord) == 0 && len(inflight) == 0 { + if !win.load.AssetsManager.DexClient().Active() { doShutdown() return }