diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-08-08 11:24:59 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-08-10 14:09:19 -0400 |
commit | fa85c985edbfd297aefb613445deab37c8769753 (patch) | |
tree | 9aba137a23638c981dc0a509b592b60a4974cebe /test/functional/test_framework/mininode.py | |
parent | e254ff5d53b79bee29203b965fca572f218bff54 (diff) | |
download | bitcoin-fa85c985edbfd297aefb613445deab37c8769753.tar.xz |
qa: Add p2p_invalid_locator test
Diffstat (limited to 'test/functional/test_framework/mininode.py')
-rwxr-xr-x | test/functional/test_framework/mininode.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/test_framework/mininode.py b/test/functional/test_framework/mininode.py index ccf767d357..b32d3edcc0 100755 --- a/test/functional/test_framework/mininode.py +++ b/test/functional/test_framework/mininode.py @@ -332,6 +332,15 @@ class P2PInterface(P2PConnection): test_function = lambda: self.last_message.get("block") and self.last_message["block"].block.rehash() == blockhash wait_until(test_function, timeout=timeout, lock=mininode_lock) + def wait_for_header(self, blockhash, timeout=60): + def test_function(): + last_headers = self.last_message.get('headers') + if not last_headers: + return False + return last_headers.headers[0].rehash() == blockhash + + wait_until(test_function, timeout=timeout, lock=mininode_lock) + def wait_for_getdata(self, timeout=60): """Waits for a getdata message. |