MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / send_without_ping

Method send_without_ping

test/functional/test_framework/p2p.py:390–404  ·  view source on GitHub ↗

Send a P2P message over the socket. This method takes a P2P payload, builds the P2P header and adds the message to the send buffer to be sent over the socket. When a message does not lead to a disconnect, send_and_ping is usually preferred to send a message. This ca

(self, message, is_decoy=False)

Source from the content-addressed store, hash-verified

388 # Socket write methods
389
390 def send_without_ping(self, message, is_decoy=False):
391 """Send a P2P message over the socket.
392
393 This method takes a P2P payload, builds the P2P header and adds
394 the message to the send buffer to be sent over the socket.
395
396 When a message does not lead to a disconnect, send_and_ping is usually
397 preferred to send a message. This can help to reduce intermittent test
398 failures due to a missing sync. Also, it includes a call to
399 sync_with_ping, allowing for concise test code.
400 """
401 with self._send_lock:
402 tmsg = self.build_message(message, is_decoy)
403 self._log_message("send", message)
404 return self.send_raw_message(tmsg)
405
406 def send_raw_message(self, raw_message_bytes):
407 if not self.is_connected:

Callers 15

send_get_dataMethod · 0.80
send_get_headersMethod · 0.80
send_block_invMethod · 0.80
send_getblocksMethod · 0.80
test_null_locatorsMethod · 0.80
test_nonnull_locatorsMethod · 0.80
run_testMethod · 0.80
run_testMethod · 0.80
run_testMethod · 0.80

Calls 3

build_messageMethod · 0.95
_log_messageMethod · 0.95
send_raw_messageMethod · 0.95

Tested by 15

test_null_locatorsMethod · 0.64
test_nonnull_locatorsMethod · 0.64
test_oversized_msgMethod · 0.64
run_testMethod · 0.64
test_in_flight_maxMethod · 0.64
test_expiry_fallbackMethod · 0.64