mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-13 06:44:41 +02:00
test: hoist p2p values to test framework constants
This commit is contained in:
@ -45,6 +45,10 @@ MAX_MONEY = 21000000 * COIN
|
||||
|
||||
BIP125_SEQUENCE_NUMBER = 0xfffffffd # Sequence number that is BIP 125 opt-in and BIP 68-opt-out
|
||||
|
||||
MAX_PROTOCOL_MESSAGE_LENGTH = 4000000 # Maximum length of incoming protocol messages
|
||||
MAX_HEADERS_RESULTS = 2000 # Number of headers sent in one getheaders result
|
||||
MAX_INV_SIZE = 50000 # Maximum number of entries in an 'inv' protocol message
|
||||
|
||||
NODE_NETWORK = (1 << 0)
|
||||
NODE_GETUTXO = (1 << 1)
|
||||
NODE_BLOOM = (1 << 2)
|
||||
|
@ -26,6 +26,7 @@ import threading
|
||||
|
||||
from test_framework.messages import (
|
||||
CBlockHeader,
|
||||
MAX_HEADERS_RESULTS,
|
||||
MIN_VERSION_SUPPORTED,
|
||||
msg_addr,
|
||||
msg_block,
|
||||
@ -553,7 +554,6 @@ class P2PDataStore(P2PInterface):
|
||||
return
|
||||
|
||||
headers_list = [self.block_store[self.last_block_hash]]
|
||||
maxheaders = 2000
|
||||
while headers_list[-1].sha256 not in locator.vHave:
|
||||
# Walk back through the block store, adding headers to headers_list
|
||||
# as we go.
|
||||
@ -569,7 +569,7 @@ class P2PDataStore(P2PInterface):
|
||||
break
|
||||
|
||||
# Truncate the list if there are too many headers
|
||||
headers_list = headers_list[:-maxheaders - 1:-1]
|
||||
headers_list = headers_list[:-MAX_HEADERS_RESULTS - 1:-1]
|
||||
response = msg_headers(headers_list)
|
||||
|
||||
if response is not None:
|
||||
|
Reference in New Issue
Block a user