Send a message to the connected node
(self, message)
| 369 | self.wait_for(VerAckMessage) |
| 370 | |
| 371 | def send(self, message): |
| 372 | '''Send a message to the connected node''' |
| 373 | # create a network envelope |
| 374 | envelope = NetworkEnvelope( |
| 375 | message.command, message.serialize(), testnet=self.testnet) |
| 376 | if self.logging: |
| 377 | print('sending: {}'.format(envelope)) |
| 378 | # send the serialized envelope over the socket using sendall |
| 379 | self.socket.sendall(envelope.serialize()) |
| 380 | |
| 381 | def read(self): |
| 382 | '''Read a message from the socket''' |
no test coverage detected