eth/protocols/snap, eth/downloader: don't use bloom filter in snap sync
This commit is contained in:
@ -177,7 +177,11 @@ func newHandler(config *handlerConfig) (*handler, error) {
|
||||
// Construct the downloader (long sync) and its backing state bloom if fast
|
||||
// sync is requested. The downloader is responsible for deallocating the state
|
||||
// bloom when it's done.
|
||||
if atomic.LoadUint32(&h.fastSync) == 1 {
|
||||
// Note: we don't enable it if snap-sync is performed, since it's very heavy
|
||||
// and the heal-portion of the snap sync is much lighter than fast. What we particularly
|
||||
// want to avoid, is a 90%-finished (but restarted) snap-sync to begin
|
||||
// indexing the entire trie
|
||||
if atomic.LoadUint32(&h.fastSync) == 1 && atomic.LoadUint32(&h.snapSync) == 0 {
|
||||
h.stateBloom = trie.NewSyncBloom(config.BloomCache, config.Database)
|
||||
}
|
||||
h.downloader = downloader.New(h.checkpointNumber, config.Database, h.stateBloom, h.eventMux, h.chain, nil, h.removePeer)
|
||||
|
Reference in New Issue
Block a user