check whether the active symbol is empty

This commit is contained in:
Alfred Kamanda 2024-10-12 16:28:02 +03:00
parent a5b1c5b74e
commit e9684fcf45
Signed by: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -652,6 +652,20 @@ func (h *Handlers) CheckBalance(ctx context.Context, sym string, input []byte) (
return res, nil
}
return res, err
}
if len(activeSym) == 0 {
logg.Printf(logging.LVL_INFO, "Using the default sym to fetch balance")
balance, err := h.accountService.CheckBalance(string(publicKey))
if err != nil {
return res, err
}
res.Content = balance
return res, nil
}
activeBal, err := store.ReadEntry(ctx, sessionId, utils.DATA_ACTIVE_BAL)