Remove debug logging related to NodeInfo processing in various components to clean up the codebase.

This commit is contained in:
Andy Oknen 2025-08-15 15:46:45 +00:00
parent e473c62936
commit 4935fcf226
4 changed files with 0 additions and 29 deletions

View file

@ -200,26 +200,14 @@ func run() int {
// Extract name from NodeInfo if available
if peer.NodeInfo != "" {
fmt.Printf("[DEBUG] Peer %s has NodeInfo: %s\n", peer.IPAddress, peer.NodeInfo)
var nodeInfo map[string]interface{}
if err := json.Unmarshal([]byte(peer.NodeInfo), &nodeInfo); err == nil {
fmt.Printf("[DEBUG] Parsed NodeInfo for %s: %+v\n", peer.IPAddress, nodeInfo)
if nameValue, ok := nodeInfo["name"]; ok {
fmt.Printf("[DEBUG] Found name field for %s: %v (type: %T)\n", peer.IPAddress, nameValue, nameValue)
if nameStr, ok := nameValue.(string); ok && nameStr != "" {
name = nameStr
fmt.Printf("[DEBUG] Set name for %s: %s\n", peer.IPAddress, name)
} else {
fmt.Printf("[DEBUG] Name field for %s is not a non-empty string\n", peer.IPAddress)
}
} else {
fmt.Printf("[DEBUG] No 'name' field found in NodeInfo for %s\n", peer.IPAddress)
}
} else {
fmt.Printf("[DEBUG] Failed to parse NodeInfo JSON for %s: %v\n", peer.IPAddress, err)
}
} else {
fmt.Printf("[DEBUG] Peer %s has empty NodeInfo\n", peer.IPAddress)
}
uristring := peer.URI

View file

@ -2,7 +2,6 @@ package admin
import (
"encoding/hex"
"fmt"
"net"
"slices"
"strings"
@ -70,9 +69,6 @@ func (a *AdminSocket) getPeersHandler(_ *GetPeersRequest, res *GetPeersResponse)
// Add NodeInfo if available
if len(p.NodeInfo) > 0 {
peer.NodeInfo = string(p.NodeInfo)
fmt.Printf("[DEBUG] Admin: Added NodeInfo for peer %s: %s\n", peer.IPAddress, peer.NodeInfo)
} else {
fmt.Printf("[DEBUG] Admin: No NodeInfo for peer %s\n", peer.IPAddress)
}
res.Peers = append(res.Peers, peer)

View file

@ -3,7 +3,6 @@ package core
import (
"crypto/ed25519"
"encoding/json"
"fmt"
"net"
"net/url"
"sync/atomic"
@ -98,9 +97,6 @@ func (c *Core) GetPeers() []PeerInfo {
if len(state._nodeInfo) > 0 {
peerinfo.NodeInfo = make([]byte, len(state._nodeInfo))
copy(peerinfo.NodeInfo, state._nodeInfo)
fmt.Printf("[DEBUG] Core: Added NodeInfo from handshake for link state: %s\n", string(state._nodeInfo))
} else {
fmt.Printf("[DEBUG] Core: No NodeInfo in link state\n")
}
}
if p, ok := conns[conn]; ok {

View file

@ -615,9 +615,6 @@ func (l *links) handler(linkType linkType, options linkOptions, conn net.Conn, s
if len(nodeInfo) > 0 {
meta.nodeInfo = make([]byte, len(nodeInfo))
copy(meta.nodeInfo, nodeInfo)
fmt.Printf("[DEBUG] Link: Adding our NodeInfo to handshake: %s\n", string(nodeInfo))
} else {
fmt.Printf("[DEBUG] Link: No NodeInfo to add to handshake\n")
}
})
@ -679,18 +676,12 @@ func (l *links) handler(linkType linkType, options linkOptions, conn net.Conn, s
// Store the received NodeInfo in the link state
if len(meta.nodeInfo) > 0 {
fmt.Printf("[DEBUG] Link: Received NodeInfo from peer: %s\n", string(meta.nodeInfo))
if linkState != nil {
phony.Block(l, func() {
linkState._nodeInfo = make([]byte, len(meta.nodeInfo))
copy(linkState._nodeInfo, meta.nodeInfo)
fmt.Printf("[DEBUG] Link: Stored NodeInfo in link state\n")
})
} else {
fmt.Printf("[DEBUG] Link: linkState is nil, cannot store NodeInfo\n")
}
} else {
fmt.Printf("[DEBUG] Link: No NodeInfo received from peer\n")
}
dir := "outbound"