Commit e5d76274 authored by obscuren's avatar obscuren

eth: 100% block propogation

parent a225ef9c
...@@ -2,7 +2,6 @@ package eth ...@@ -2,7 +2,6 @@ package eth
import ( import (
"fmt" "fmt"
"math"
"math/big" "math/big"
"sync" "sync"
"time" "time"
...@@ -359,7 +358,7 @@ func (pm *ProtocolManager) verifyTd(peer *peer, request newBlockMsgData) error { ...@@ -359,7 +358,7 @@ func (pm *ProtocolManager) verifyTd(peer *peer, request newBlockMsgData) error {
func (pm *ProtocolManager) BroadcastBlock(hash common.Hash, block *types.Block) { func (pm *ProtocolManager) BroadcastBlock(hash common.Hash, block *types.Block) {
// Broadcast block to a batch of peers not knowing about it // Broadcast block to a batch of peers not knowing about it
peers := pm.peers.PeersWithoutBlock(hash) peers := pm.peers.PeersWithoutBlock(hash)
peers = peers[:int(math.Sqrt(float64(len(peers))))] //peers = peers[:int(math.Sqrt(float64(len(peers))))]
for _, peer := range peers { for _, peer := range peers {
peer.sendNewBlock(block) peer.sendNewBlock(block)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment