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

Method wait_for_getdata

test/functional/test_framework/p2p.py:659–669  ·  view source on GitHub ↗

Waits for a getdata message. The object hashes in the inventory vector must match the provided hash_list.

(self, hash_list, *, timeout=60)

Source from the content-addressed store, hash-verified

657 self.wait_until(test_function, timeout=timeout)
658
659 def wait_for_getdata(self, hash_list, *, timeout=60):
660 """Waits for a getdata message.
661
662 The object hashes in the inventory vector must match the provided hash_list."""
663 def test_function():
664 last_data = self.last_message.get("getdata")
665 if not last_data:
666 return False
667 return [x.hash for x in last_data.inv] == hash_list
668
669 self.wait_until(test_function, timeout=timeout)
670
671 def wait_for_getheaders(self, block_hash=None, *, timeout=60):
672 """Waits for a getheaders message containing a specific block hash.

Callers 15

test_nonnull_locatorsMethod · 0.80
run_testMethod · 0.80
run_testMethod · 0.80
ignores_cmpctblockMethod · 0.80
run_testMethod · 0.80
announce_cmpct_blockMethod · 0.80

Calls 1

wait_untilMethod · 0.95