Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc_p2p_avalanche_peer_discovery.py
Show First 20 Lines • Show All 244 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
"Check that the peer gets added immediately if the proof is already known") | "Check that the peer gets added immediately if the proof is already known") | ||||
# Connect another peer using the same proof | # Connect another peer using the same proof | ||||
peer_proof_known = get_ava_p2p_interface(node) | peer_proof_known = get_ava_p2p_interface(node) | ||||
peer_proof_known.send_avahello(interface_delegation_hex, delegated_key) | peer_proof_known.send_avahello(interface_delegation_hex, delegated_key) | ||||
self.wait_until(lambda: has_node_count(2)) | self.wait_until(lambda: has_node_count(2)) | ||||
self.log.info("Check that repeated avahello messages are ignored") | |||||
for i in range(3): | |||||
with node.assert_debug_log(['Ignoring avahello from peer']): | |||||
peer_proof_known.send_avahello( | |||||
interface_delegation_hex, delegated_key) | |||||
self.log.info("Invalidate the proof and check the nodes are removed") | self.log.info("Invalidate the proof and check the nodes are removed") | ||||
tip = node.getbestblockhash() | tip = node.getbestblockhash() | ||||
# Invalidate the block with the proof utxo | # Invalidate the block with the proof utxo | ||||
node.invalidateblock(blockhashes[1]) | node.invalidateblock(blockhashes[1]) | ||||
# Change the address to make sure we don't generate a block identical | # Change the address to make sure we don't generate a block identical | ||||
# to the one we just invalidated. Can be generate(1) after D9694 or | # to the one we just invalidated. Can be generate(1) after D9694 or | ||||
# D9697 is landed. | # D9697 is landed. | ||||
forked_tip = node.generatetoaddress(1, ADDRESS_ECREG_UNSPENDABLE)[0] | forked_tip = node.generatetoaddress(1, ADDRESS_ECREG_UNSPENDABLE)[0] | ||||
Show All 13 Lines |