mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
fix: replace assert to require
This commit is contained in:
parent
b44ca3c190
commit
a75e981c5b
2 changed files with 3 additions and 1 deletions
|
|
@ -1860,11 +1860,13 @@ func (p *PortalProtocol) Gossip(srcNodeId *enode.ID, contentKeys [][]byte, conte
|
|||
maxClosestNodes := 4
|
||||
maxFartherNodes := 4
|
||||
closestLocalNodes := p.findNodesCloseToContent(contentId, 32)
|
||||
p.Log.Debug("closest local nodes", "count", len(closestLocalNodes))
|
||||
|
||||
gossipNodes := make([]*enode.Node, 0)
|
||||
for _, n := range closestLocalNodes {
|
||||
radius, found := p.radiusCache.HasGet(nil, []byte(n.ID().String()))
|
||||
if found {
|
||||
p.Log.Debug("found closest local nodes", "nodeId", n.ID(), "addr", n.IPAddr().String())
|
||||
nodeRadius := new(uint256.Int)
|
||||
err := nodeRadius.UnmarshalSSZ(radius)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import (
|
|||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/p2p/discover/portalwire"
|
||||
"github.com/ethereum/go-ethereum/p2p/enode"
|
||||
"github.com/stretchr/testify/assert"
|
||||
assert "github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func setupLocalPortalNode(addr string, bootNodes []*enode.Node) (*PortalProtocol, error) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue