mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-20 03:39:48 +02:00
Merge #13915: [qa] Add test for max number of entries in locator
fa85c985ed qa: Add p2p_invalid_locator test (MarcoFalke)
Pull request description:
Should not be merged *before* #13907
Tree-SHA512: a67ca407854c421ed20a184d0b0dc90085aed3e3431d9652a107fa3022244767e67f67e50449b7e95721f56906836b134615875f28a21e8a012eb22cfe6a66a5
This commit is contained in:
@@ -32,6 +32,7 @@ MY_SUBVERSION = b"/python-mininode-tester:0.0.3/"
|
||||
MY_RELAY = 1 # from version 70001 onwards, fRelay should be appended to version messages (BIP37)
|
||||
|
||||
MAX_INV_SZ = 50000
|
||||
MAX_LOCATOR_SZ = 101
|
||||
MAX_BLOCK_BASE_SIZE = 1000000
|
||||
|
||||
COIN = 100000000 # 1 btc in satoshis
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user