Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_fingerprint.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2017 The Bitcoin Core developers | # Copyright (c) 2017 The Bitcoin Core developers | ||||
# Distributed under the MIT software license, see the accompanying | # Distributed under the MIT software license, see the accompanying | ||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
"""Test various fingerprinting protections. | """Test various fingerprinting protections. | ||||
If a stale block more than a month old or its header are requested by a peer, | If a stale block more than a month old or its header are requested by a peer, | ||||
the node should pretend that it does not have it to avoid fingerprinting. | the node should pretend that it does not have it to avoid fingerprinting. | ||||
""" | """ | ||||
import time | import time | ||||
from test_framework.blocktools import (create_block, create_coinbase) | from test_framework.blocktools import create_block, create_coinbase | ||||
from test_framework.messages import ( | from test_framework.messages import ( | ||||
CInv, | |||||
MSG_BLOCK, | MSG_BLOCK, | ||||
CInv, | |||||
msg_block, | msg_block, | ||||
msg_getdata, | msg_getdata, | ||||
msg_getheaders, | msg_getheaders, | ||||
msg_headers, | msg_headers, | ||||
) | ) | ||||
from test_framework.p2p import P2PInterface | from test_framework.p2p import P2PInterface | ||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
from test_framework.util import assert_equal, wait_until | from test_framework.util import assert_equal, wait_until | ||||
▲ Show 20 Lines • Show All 130 Lines • Show Last 20 Lines |