Waits for a getdata message. The object hashes in the inventory vector must match the provided hash_list.
(self, hash_list, *, timeout=60)
| 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. |