Skip to content

Commit

Permalink
ignore subnets in disc
Browse files Browse the repository at this point in the history
  • Loading branch information
y0sher committed Jun 2, 2024
1 parent 39d42f7 commit 84cafab
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions network/discovery/dv5_service.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package discovery

import (
"bytes"
"context"
"fmt"
"net"
"sync/atomic"
"time"
Expand Down Expand Up @@ -158,12 +156,12 @@ func (dvs *DiscV5Service) checkPeer(logger *zap.Logger, e PeerEvent) error {

// Get the peer's subnets, skipping if it has none.
nodeSubnets, err := records.GetSubnetsEntry(e.Node.Record())
if err != nil {
return fmt.Errorf("could not read subnets: %w", err)
}
if bytes.Equal(zeroSubnets, nodeSubnets) {
return errors.New("zero subnets")
}
//if err != nil {
// return fmt.Errorf("could not read subnets: %w", err)
//}
//if bytes.Equal(zeroSubnets, nodeSubnets) {
// return errors.New("zero subnets")
//}

dvs.subnetsIdx.UpdatePeerSubnets(e.AddrInfo.ID, nodeSubnets)
if !dvs.limitNodeFilter(e.Node) && !dvs.sharedSubnetsFilter(1)(e.Node) {
Expand Down

0 comments on commit 84cafab

Please sign in to comment.