mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 09:51:36 +00:00
The disconnect-message branch in statusExchange had two bugs that are the twin of the one fixed in rlpxcmd.go by #34781: the error return from rlp.DecodeBytes was ignored, so decode failures silently produced an "invalid disconnect message" error with no context; and the decoder assumed the spec-compliant list form exclusively, while older geth and some other implementations send the reason as a bare byte. Add a decodeDisconnect helper that accepts both wire forms (matching the legacy-tolerant behavior in p2p.decodeDisconnectMessage) and, on decode failure, include the raw payload so operators can see exactly what the peer sent. Add a unit test for the decoder covering both forms plus the empty-payload error path. |
||
|---|---|---|
| .. | ||
| testdata | ||
| chain.go | ||
| chain_test.go | ||
| conn.go | ||
| conn_test.go | ||
| engine.go | ||
| mkchain.sh | ||
| protocol.go | ||
| snap.go | ||
| suite.go | ||
| suite_test.go | ||
| transaction.go | ||