@@ -23,6 +23,7 @@ import (
23
23
24
24
"github.com/ethereum/go-ethereum/common"
25
25
"github.com/ethereum/go-ethereum/core"
26
+ "github.com/ethereum/go-ethereum/core/rawdb"
26
27
"github.com/ethereum/go-ethereum/core/types"
27
28
"github.com/ethereum/go-ethereum/metrics"
28
29
"github.com/ethereum/go-ethereum/p2p"
@@ -95,11 +96,15 @@ type TxPool interface {
95
96
96
97
// MakeProtocols constructs the P2P protocol definitions for `eth`.
97
98
func MakeProtocols (backend Backend , network uint64 , dnsdisc enode.Iterator ) []p2p.Protocol {
98
- protocols := make ([]p2p.Protocol , len (ProtocolVersions ))
99
- for i , version := range ProtocolVersions {
99
+ protocols := make ([]p2p.Protocol , 0 , len (ProtocolVersions ))
100
+ for _ , version := range ProtocolVersions {
100
101
version := version // Closure
101
102
102
- protocols [i ] = p2p.Protocol {
103
+ // Path scheme does not support GetNodeData, don't advertise eth66 on it
104
+ if version <= ETH66 && backend .Chain ().TrieDB ().Scheme () == rawdb .PathScheme {
105
+ continue
106
+ }
107
+ protocols = append (protocols , p2p.Protocol {
103
108
Name : ProtocolName ,
104
109
Version : version ,
105
110
Length : protocolLengths [version ],
@@ -119,7 +124,7 @@ func MakeProtocols(backend Backend, network uint64, dnsdisc enode.Iterator) []p2
119
124
},
120
125
Attributes : []enr.Entry {currentENREntry (backend .Chain ())},
121
126
DialCandidates : dnsdisc ,
122
- }
127
+ })
123
128
}
124
129
return protocols
125
130
}
0 commit comments