feat(snapshot): Close snapshot p2p protocol when using zktrie. (#239)

* Close snapshot p2p protocol when use zktrie.

* trigger ci
This commit is contained in:
maskpp 2023-03-06 12:26:17 +08:00 committed by GitHub
parent cfbb26922f
commit 018c2cca43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -516,7 +516,7 @@ func (s *Ethereum) BloomIndexer() *core.ChainIndexer { return s.bloomIndexer }
// network protocols to start.
func (s *Ethereum) Protocols() []p2p.Protocol {
protos := eth.MakeProtocols((*ethHandler)(s.handler), s.networkID, s.ethDialCandidates)
if s.config.SnapshotCache > 0 {
if !s.blockchain.Config().Zktrie && s.config.SnapshotCache > 0 {
protos = append(protos, snap.MakeProtocols((*snapHandler)(s.handler), s.snapDialCandidates)...)
}
return protos