Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/mininode.py
Context not available. | |||||
else: | else: | ||||
logger.error("Cannot send message. No connection to node!") | logger.error("Cannot send message. No connection to node!") | ||||
def send_raw_message(self, message): | |||||
if self.connection: | |||||
self.connection.send_raw_message(message) | |||||
else: | |||||
logger.error("Cannot send raw message. No connection to node!") | |||||
def send_and_ping(self, message): | def send_and_ping(self, message): | ||||
self.send_message(message) | self.send_message(message) | ||||
self.sync_with_ping() | self.sync_with_ping() | ||||
Context not available. | |||||
h = sha256(th) | h = sha256(th) | ||||
tmsg += h[:4] | tmsg += h[:4] | ||||
tmsg += data | tmsg += data | ||||
self.set_sendbuf(tmsg, pushbuf) | |||||
def send_raw_message(self, rawmessage, pushbuf=False): | |||||
if self.state != "connected" and not pushbuf: | |||||
raise IOError('Not connected, no pushbuf') | |||||
self._log_message("send", rawmessage) | |||||
self.set_sendbuf(rawmessage, pushbuf) | |||||
def set_sendbuf(self, tmsg, pushbuf=False): | |||||
with mininode_lock: | with mininode_lock: | ||||
if (len(self.sendbuf) == 0 and not pushbuf): | if (len(self.sendbuf) == 0 and not pushbuf): | ||||
try: | try: | ||||
Context not available. |