aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/handshake.go
Commit message (Collapse)AuthorAgeFilesLines
* p2p: fix goroutine leak when handshake read failsFelix Lange2015-04-131-1/+1
| | | | This regression was introduced in b3c058a9e4e9.
* p2p: improve disconnect signaling at handshake timeFelix Lange2015-04-101-26/+42
| | | | | | | As of this commit, p2p will disconnect nodes directly after the encryption handshake if too many peer connections are active. Errors in the protocol handshake packet are now handled more politely by sending a disconnect packet before closing the connection.
* p2p: fix Peer shutdown deadlocksFelix Lange2015-04-101-1/+1
| | | | | | | | | | There were multiple synchronization issues in the disconnect handling, all caused by the odd special-casing of Peer.readLoop errors. Remove the special handling of read errors and make readLoop part of the Peer WaitGroup. Thanks to @Gustav-Simonsson for pointing at arrows in a diagram and playing rubber-duck.
* p2p: use package rlp to encode messagesFelix Lange2015-03-191-6/+2
| | | | | | | | | | Message encoding functions have been renamed to catch any uses. The switch to the new encoder can cause subtle incompatibilities. If there are any users outside of our tree, they will at least be alerted that there was a change. NewMsg no longer exists. The replacements for EncodeMsg are called Send and SendItems.
* p2p: restore read/write timeoutsFelix Lange2015-03-041-5/+3
| | | | They got lost in the transition to rlpxFrameRW.
* p2p: verify protocol handshake node IDFelix Lange2015-03-041-0/+3
|
* p2p: make encryption handshake code easier to followFelix Lange2015-03-041-242/+207
| | | | | | | | | This mostly changes how information is passed around. Instead of using many function parameters and return values, put the entire state in a struct and pass that. This also adds back derivation of ecdhe-shared-secret. I deleted it by accident in a previous refactoring.
* p2p: use RLPx frames for messagingFelix Lange2015-03-041-17/+10
|
* p2p: encrypted and authenticated RLPx frame I/OFelix Lange2015-03-041-57/+100
|
* p2p: disable encryption handshakeFelix Lange2015-02-191-0/+434
The diff is a bit bigger than expected because the protocol handshake logic has moved out of Peer. This is necessary because the protocol handshake will have custom framing in the final protocol.