diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-06-09 21:05:40 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-06-09 21:12:24 +0800 |
commit | ff84352fb73bdbb07a7b2cf24b417927bf5a5c5e (patch) | |
tree | 8801c98f449f703df6af94a5809fed9377d4f2b4 /p2p | |
parent | ca8cb65b73b5bdb6a30b6a45304b3c45acc66bcc (diff) | |
download | dexon-ff84352fb73bdbb07a7b2cf24b417927bf5a5c5e.tar.gz dexon-ff84352fb73bdbb07a7b2cf24b417927bf5a5c5e.tar.zst dexon-ff84352fb73bdbb07a7b2cf24b417927bf5a5c5e.zip |
p2p: fix close data race
Diffstat (limited to 'p2p')
-rw-r--r-- | p2p/rlpx.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/p2p/rlpx.go b/p2p/rlpx.go index e1cb13aae..6bbf20671 100644 --- a/p2p/rlpx.go +++ b/p2p/rlpx.go @@ -102,6 +102,7 @@ func (t *rlpx) doProtoHandshake(our *protoHandshake) (their *protoHandshake, err werr := make(chan error, 1) go func() { werr <- Send(t.rw, handshakeMsg, our) }() if their, err = readProtocolHandshake(t.rw, our); err != nil { + <-werr // make sure the write terminates too return nil, err } if err := <-werr; err != nil { |