diff --git a/cmd/bee/cmd/cmd.go b/cmd/bee/cmd/cmd.go index 2e9319d3fc1..9ca1bb2d90d 100644 --- a/cmd/bee/cmd/cmd.go +++ b/cmd/bee/cmd/cmd.go @@ -86,7 +86,7 @@ const ( optionNameStateStoreCacheCapacity = "statestore-cache-capacity" optionNameTargetNeighborhood = "target-neighborhood" optionNameNeighborhoodSuggester = "neighborhood-suggester" - optionNameWhitelistedWithdrawalAddress = "withdraw-address" + optionNameWhitelistedWithdrawalAddress = "withdrawal-addresses-whitelist" ) // nolint:gochecknoinits diff --git a/pkg/api/wallet.go b/pkg/api/wallet.go index 8dc8d89847c..ff1f6411f21 100644 --- a/pkg/api/wallet.go +++ b/pkg/api/wallet.go @@ -86,13 +86,11 @@ func (s *Service) walletWithdrawHandler(w http.ResponseWriter, r *http.Request) if strings.EqualFold("BZZ", *path.Coin) { bzz = true } else if !strings.EqualFold("NativeToken", *path.Coin) { - logger.Error(nil, "invalid coin type") jsonhttp.BadRequest(w, "only BZZ or NativeToken options are accepted") return } if !slices.Contains(s.whitelistedWithdrawalAddress, *queries.Address) { - logger.Error(nil, "provided address not whitelisted") jsonhttp.BadRequest(w, "provided address not whitelisted") return } @@ -123,14 +121,12 @@ func (s *Service) walletWithdrawHandler(w http.ResponseWriter, r *http.Request) nativeToken, err := s.chainBackend.BalanceAt(r.Context(), s.ethereumAddress, nil) if err != nil { - logger.Debug("unable to acquire balance from the chain backend", "error", err) - logger.Error(nil, "unable to acquire balance from the chain backend") + logger.Error(err, "unable to acquire balance from the chain backend") jsonhttp.InternalServerError(w, "unable to acquire balance from the chain backend") return } if queries.Amount.Cmp(nativeToken) > 0 { - logger.Error(err, "not enough balance") jsonhttp.BadRequest(w, "not enough balance") return }