Skip to content
forked from c9s/bbgo

Commit

Permalink
xalign: add more withdraw checking logs
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Aug 6, 2024
1 parent e03ba63 commit a24a118
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/strategy/xalign/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion pkg/types/withdraw.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 + ":"
Expand All @@ -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
}

Expand Down

0 comments on commit a24a118

Please sign in to comment.