Added last step of negotiation.

This commit is contained in:
Brendan Mc 2014-09-03 21:38:29 -04:00
parent 0e185788fc
commit 80ec51f129

View File

@ -226,6 +226,15 @@ func Handshake(self, remote *peer.Peer, in, out chan []byte) (chan []byte, chan
}
}()
finished := []byte("Finished")
secureOut <- finished
resp2 := <-secureIn
if bytes.Compare(resp2, finished) != 0 {
return nil, nil, errors.New("Negotiation failed.")
}
u.DOut("[%s] identify: Got node id: %s\n", self.ID.Pretty(), remote.ID.Pretty())
return secureIn, secureOut, nil