Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_eviction.py
Show All 9 Lines | |||||
We cannot currently test the parts of the eviction logic that are based on | We cannot currently test the parts of the eviction logic that are based on | ||||
address/netgroup since in the current framework, all peers are connecting from | address/netgroup since in the current framework, all peers are connecting from | ||||
the same local address. See Issue #14210 for more info. | the same local address. See Issue #14210 for more info. | ||||
Therefore, this test is limited to the remaining protection criteria. | Therefore, this test is limited to the remaining protection criteria. | ||||
""" | """ | ||||
import time | import time | ||||
from test_framework.test_framework import BitcoinTestFramework | |||||
from test_framework.p2p import P2PInterface, P2PDataStore | |||||
from test_framework.util import assert_equal, wait_until | |||||
from test_framework.blocktools import create_block, create_coinbase | from test_framework.blocktools import create_block, create_coinbase | ||||
from test_framework.messages import CTransaction, FromHex, msg_pong, msg_tx | from test_framework.messages import CTransaction, FromHex, msg_pong, msg_tx | ||||
from test_framework.p2p import P2PDataStore, P2PInterface | |||||
from test_framework.test_framework import BitcoinTestFramework | |||||
from test_framework.util import assert_equal, wait_until | |||||
class SlowP2PDataStore(P2PDataStore): | class SlowP2PDataStore(P2PDataStore): | ||||
def on_ping(self, message): | def on_ping(self, message): | ||||
time.sleep(0.1) | time.sleep(0.1) | ||||
self.send_message(msg_pong(message.nonce)) | self.send_message(msg_pong(message.nonce)) | ||||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |