]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Tidy up function signature
authorMatt Joiner <anacrolix@gmail.com>
Fri, 19 Jul 2019 04:56:29 +0000 (14:56 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Fri, 19 Jul 2019 04:56:29 +0000 (14:56 +1000)
peer_protocol/handshake.go

index fe232948b562a1898dfcf14d5212411af5a98ef3..b8cff0ff00761a122d0ea450ac7a785175520586 100644 (file)
@@ -69,11 +69,14 @@ type HandshakeResult struct {
        metainfo.Hash
 }
 
-// ih is nil if we expect the peer to declare the InfoHash, such as when the
-// peer initiated the connection. Returns ok if the Handshake was successful,
-// and err if there was an unexpected condition other than the peer simply
-// abandoning the Handshake.
-func Handshake(sock io.ReadWriter, ih *metainfo.Hash, peerID [20]byte, extensions PeerExtensionBits) (res HandshakeResult, ok bool, err error) {
+// ih is nil if we expect the peer to declare the InfoHash, such as when the peer initiated the
+// connection. Returns ok if the Handshake was successful, and err if there was an unexpected
+// condition other than the peer simply abandoning the Handshake.
+func Handshake(
+       sock io.ReadWriter, ih *metainfo.Hash, peerID [20]byte, extensions PeerExtensionBits,
+) (
+       res HandshakeResult, ok bool, err error,
+) {
        // Bytes to be sent to the peer. Should never block the sender.
        postCh := make(chan []byte, 4)
        // A single error value sent when the writer completes.