Skip to content

Commit a75e981

Browse files
thinkAfCodGrapeBaBa
authored andcommitted
fix: replace assert to require
1 parent b44ca3c commit a75e981

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

p2p/discover/portal_protocol.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1860,11 +1860,13 @@ func (p *PortalProtocol) Gossip(srcNodeId *enode.ID, contentKeys [][]byte, conte
18601860
maxClosestNodes := 4
18611861
maxFartherNodes := 4
18621862
closestLocalNodes := p.findNodesCloseToContent(contentId, 32)
1863+
p.Log.Debug("closest local nodes", "count", len(closestLocalNodes))
18631864

18641865
gossipNodes := make([]*enode.Node, 0)
18651866
for _, n := range closestLocalNodes {
18661867
radius, found := p.radiusCache.HasGet(nil, []byte(n.ID().String()))
18671868
if found {
1869+
p.Log.Debug("found closest local nodes", "nodeId", n.ID(), "addr", n.IPAddr().String())
18681870
nodeRadius := new(uint256.Int)
18691871
err := nodeRadius.UnmarshalSSZ(radius)
18701872
if err != nil {

p2p/discover/portal_protocol_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/ethereum/go-ethereum/log"
2222
"github.com/ethereum/go-ethereum/p2p/discover/portalwire"
2323
"github.com/ethereum/go-ethereum/p2p/enode"
24-
"github.com/stretchr/testify/assert"
24+
assert "github.com/stretchr/testify/require"
2525
)
2626

2727
func setupLocalPortalNode(addr string, bootNodes []*enode.Node) (*PortalProtocol, error) {

0 commit comments

Comments
 (0)