From 88d144e65e1c24825c84a095c878feb152852cf8 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 21 Jun 2021 13:00:20 +1000 Subject: [PATCH] Minor tidying --- client.go | 4 ++-- mse/mse.go | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index c7a5f87c..e0092556 100644 --- a/client.go +++ b/client.go @@ -778,12 +778,12 @@ func (cl *Client) initiateHandshakes(c *PeerConn, t *Torrent) error { ) c.setRW(rw) if err != nil { - return xerrors.Errorf("header obfuscation handshake: %w", err) + return fmt.Errorf("header obfuscation handshake: %w", err) } } ih, err := cl.connBtHandshake(c, &t.infoHash) if err != nil { - return xerrors.Errorf("bittorrent protocol handshake: %w", err) + return fmt.Errorf("bittorrent protocol handshake: %w", err) } if ih != t.infoHash { return errors.New("bittorrent protocol handshake: peer infohash didn't match") diff --git a/mse/mse.go b/mse/mse.go index a2f2d1d9..a6010ec3 100644 --- a/mse/mse.go +++ b/mse/mse.go @@ -541,7 +541,11 @@ func (h *handshake) Do() (ret io.ReadWriter, method CryptoMethod, err error) { return } -func InitiateHandshake(rw io.ReadWriter, skey []byte, initialPayload []byte, cryptoProvides CryptoMethod) (ret io.ReadWriter, method CryptoMethod, err error) { +func InitiateHandshake( + rw io.ReadWriter, skey []byte, initialPayload []byte, cryptoProvides CryptoMethod, +) ( + ret io.ReadWriter, method CryptoMethod, err error, +) { h := handshake{ conn: rw, initer: true,