Waits for an INV message and checks that the first inv object in the message was as expected.
(self, expected_inv, timeout=60)
| 520 | self.wait_until(test_function, timeout=timeout) |
| 521 | |
| 522 | def wait_for_inv(self, expected_inv, timeout=60): |
| 523 | """Waits for an INV message and checks that the first inv object in the message was as expected.""" |
| 524 | if len(expected_inv) > 1: |
| 525 | raise NotImplementedError("wait_for_inv() will only verify the first inv object") |
| 526 | |
| 527 | def test_function(): |
| 528 | return self.last_message.get("inv") and \ |
| 529 | self.last_message["inv"].inv[0].type == expected_inv[0].type and \ |
| 530 | self.last_message["inv"].inv[0].hash == expected_inv[0].hash |
| 531 | |
| 532 | self.wait_until(test_function, timeout=timeout) |
| 533 | |
| 534 | def wait_for_verack(self, timeout=60): |
| 535 | def test_function(): |