core: added chain head reset to known block
This commit is contained in:
@ -472,6 +472,8 @@ func (d *Downloader) process() error {
|
||||
}
|
||||
break
|
||||
} else if err != nil {
|
||||
// immediatly unregister the false peer but do not disconnect
|
||||
d.UnregisterPeer(d.activePeer)
|
||||
// Reset chain completely. This needs much, much improvement.
|
||||
// instead: check all blocks leading down to this block false block and remove it
|
||||
blocks = nil
|
||||
|
@ -36,6 +36,7 @@ pm.chainman.InsertChain(blocks)
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"math/big"
|
||||
"sync"
|
||||
|
||||
@ -326,7 +327,7 @@ func (pm *ProtocolManager) BroadcastBlock(hash common.Hash, block *types.Block)
|
||||
}
|
||||
// Broadcast block to peer set
|
||||
// XXX due to the current shit state of the network disable the limit
|
||||
//peers = peers[:int(math.Sqrt(float64(len(peers))))]
|
||||
peers = peers[:int(math.Sqrt(float64(len(peers))))]
|
||||
for _, peer := range peers {
|
||||
peer.sendNewBlock(block)
|
||||
}
|
||||
|
Reference in New Issue
Block a user