Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
pschork committed Apr 30, 2024
1 parent 260de8b commit c8bdcf4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions disperser/dataapi/operator_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dataapi
import (
"context"
"errors"
"fmt"
"net"
"sort"
"strings"
Expand Down Expand Up @@ -107,6 +108,7 @@ func checkIsOnlineAndProcessOperator(operatorStatus OperatorOnlineStatus, operat

// Check that the socketString is not private/unspecified
func ValidOperatorIP(socketString string, logger logging.Logger) bool {
fmt.Printf(">>>> socketString: %s\n", socketString)
host := strings.Split(socketString, ":")[0]
ips, err := net.LookupIP(host)
if err != nil {
Expand All @@ -119,6 +121,7 @@ func ValidOperatorIP(socketString string, logger logging.Logger) bool {
return false
}
isValid := !ipAddr.IsPrivate() && !ipAddr.IsUnspecified()
fmt.Printf(">>>> isValid: %v\n", isValid)
logger.Debug("Operator IP validation", "socketString", socketString, "host", host, "ips", ips, "ipAddr", ipAddr, "isValid", isValid)

return isValid
Expand Down

0 comments on commit c8bdcf4

Please sign in to comment.