MCPcopy Create free account
hub / github.com/ElementsProject/elements / wait_for_inv

Method wait_for_inv

test/functional/test_framework/p2p.py:522–532  ·  view source on GitHub ↗

Waits for an INV message and checks that the first inv object in the message was as expected.

(self, expected_inv, timeout=60)

Source from the content-addressed store, hash-verified

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():

Callers 2

test_filterMethod · 0.45

Calls 1

wait_untilMethod · 0.95

Tested by 2

test_filterMethod · 0.36