Do a handshake with the other node. Handshake is sending a version message and getting a verack back.
(self)
| 359 | self.stream = self.socket.makefile('rb', None) |
| 360 | |
| 361 | def handshake(self): |
| 362 | '''Do a handshake with the other node. |
| 363 | Handshake is sending a version message and getting a verack back.''' |
| 364 | # create a version message |
| 365 | version = VersionMessage() |
| 366 | # send the command |
| 367 | self.send(version) |
| 368 | # wait for a verack message |
| 369 | self.wait_for(VerAckMessage) |
| 370 | |
| 371 | def send(self, message): |
| 372 | '''Send a message to the connected node''' |