Skip to content

Commit b5a0cf4

Browse files
fjlobscuren
authored andcommitted
[release/1.3.4] p2p: EIP-8 changes
Conflicts: p2p/rlpx.go
1 parent b25da7c commit b5a0cf4

File tree

4 files changed

+443
-149
lines changed

4 files changed

+443
-149
lines changed

p2p/message_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ func TestEOFSignal(t *testing.T) {
143143
}
144144

145145
func unhex(str string) []byte {
146-
b, err := hex.DecodeString(strings.Replace(str, "\n", "", -1))
146+
r := strings.NewReplacer("\t", "", " ", "", "\n", "")
147+
b, err := hex.DecodeString(r.Replace(str))
147148
if err != nil {
148149
panic(fmt.Sprintf("invalid hex string: %q", str))
149150
}

p2p/peer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ type protoHandshake struct {
5656
Caps []Cap
5757
ListenPort uint64
5858
ID discover.NodeID
59+
60+
// Ignore additional fields (for forward compatibility).
61+
Rest []rlp.RawValue `rlp:"tail"`
5962
}
6063

6164
// Peer represents a connected remote node.

0 commit comments

Comments
 (0)