xalign: add more withdraw checking logs

This commit is contained in:
c9s 2024-08-06 18:08:39 +08:00
parent e03ba63e44
commit a24a118182
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 3 additions and 1 deletions

View File

@ -145,6 +145,7 @@ func (s *Strategy) detectActiveWithdraw(
}
for _, withdraw := range withdraws {
log.Infof("checking withdraw status: %s", withdraw.String())
switch withdraw.Status {
case types.WithdrawStatusSent, types.WithdrawStatusProcessing, types.WithdrawStatusAwaitingApproval:
return &withdraw, nil

View File

@ -47,7 +47,7 @@ func cutstr(s string, maxLen, head, tail int) string {
}
func (w Withdraw) String() (o string) {
o = fmt.Sprintf("%s WITHDRAW %8f %s -> ", w.Exchange, w.Amount.Float64(), w.Asset)
o = fmt.Sprintf("%s WITHDRAW %s %s -> ", w.Exchange, w.Amount.String(), w.Asset)
if len(w.Network) > 0 && w.Network != w.Asset {
o += w.Network + ":"
@ -68,6 +68,7 @@ func (w Withdraw) String() (o string) {
o += fmt.Sprintf(" TxID: %s", cutstr(w.TransactionID, 12, 4, 4))
}
o += fmt.Sprintf(" STATUS: %s (%s)", w.Status, w.OriginalStatus)
return o
}