mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +00:00
swarm: fix swarm index out of range (#14843)
* swarm: skip empty nodes when in findBest
This commit is contained in:
parent
722bac84fa
commit
c910b7c28e
1 changed files with 6 additions and 0 deletions
|
|
@ -204,6 +204,12 @@ func (self *KadDb) findBest(maxBinSize int, binSize func(int) int) (node *NodeRe
|
|||
count++
|
||||
node = dbrow[cursor]
|
||||
|
||||
// skip empty nodes
|
||||
if node == nil {
|
||||
log.Debug(fmt.Sprintf("kaddb record (PO%03d:%d/%d) not found", po, cursor, len(dbrow)))
|
||||
continue ROW
|
||||
}
|
||||
|
||||
// skip already connected nodes
|
||||
if node.node != nil {
|
||||
log.Debug(fmt.Sprintf("kaddb record %v (PO%03d:%d/%d) already connected", node.Addr, po, cursor, len(dbrow)))
|
||||
|
|
|
|||
Loading…
Reference in a new issue