max: remove legacy emptyTime

This commit is contained in:
c9s 2024-08-05 16:40:10 +08:00
parent 5d65b817ef
commit e03ba63e44
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 6 additions and 8 deletions

View File

@ -824,8 +824,7 @@ func (e *Exchange) QueryWithdrawHistory(
limit := 1000
txIDs := map[string]struct{}{}
emptyTime := time.Time{}
if startTime == emptyTime {
if startTime.IsZero() {
startTime, err = e.getLaunchDate()
if err != nil {
return nil, err
@ -867,7 +866,7 @@ func (e *Exchange) QueryWithdrawHistory(
}
// we can convert this later
status := convertWithdrawStatus(d.State)
status := convertWithdrawStatusV3(d.Status)
txIDs[d.TxID] = struct{}{}
withdraw := types.Withdraw{
@ -881,11 +880,10 @@ func (e *Exchange) QueryWithdrawHistory(
TransactionFee: d.Fee,
TransactionFeeCurrency: d.FeeCurrency,
Network: d.NetworkProtocol,
// WithdrawOrderID: d.WithdrawOrderID,
// Network: d.Network,
Status: status,
OriginalStatus: string(d.State),
Status: status,
OriginalStatus: string(d.State),
}
allWithdraws = append(allWithdraws, withdraw)
}

View File

@ -146,7 +146,7 @@ func (s *Strategy) detectActiveWithdraw(
for _, withdraw := range withdraws {
switch withdraw.Status {
case types.WithdrawStatusProcessing, types.WithdrawStatusSent, types.WithdrawStatusAwaitingApproval:
case types.WithdrawStatusSent, types.WithdrawStatusProcessing, types.WithdrawStatusAwaitingApproval:
return &withdraw, nil
}
}