Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc_p2p_avalanche.py
Show First 20 Lines • Show All 330 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
can_find_block_in_poll(hash_to_find, BLOCK_PARKED) | can_find_block_in_poll(hash_to_find, BLOCK_PARKED) | ||||
return node.getbestblockhash() == fork_tip | return node.getbestblockhash() == fork_tip | ||||
# Because everybody answers no, the node will park that block. | # Because everybody answers no, the node will park that block. | ||||
wait_until(has_parked_new_tip, timeout=15) | wait_until(has_parked_new_tip, timeout=15) | ||||
assert_equal(node.getbestblockhash(), fork_tip) | assert_equal(node.getbestblockhash(), fork_tip) | ||||
self.log.info( | self.log.info( | ||||
"Check the node is discouraging unexpected avaresponses.") | |||||
with self.nodes[0].assert_debug_log( | |||||
['Misbehaving', 'peer=1 (0 -> 2): unexpected-ava-response']): | |||||
# unknown voting round | |||||
poll_node.send_avaresponse( | |||||
round=2**32 - 1, votes=[], privkey=privkey) | |||||
self.log.info( | |||||
"Check the node is signalling the avalanche service bit only if there is a proof.") | "Check the node is signalling the avalanche service bit only if there is a proof.") | ||||
assert_equal( | assert_equal( | ||||
int(node.getnetworkinfo()['localservices'], 16) & NODE_AVALANCHE, | int(node.getnetworkinfo()['localservices'], 16) & NODE_AVALANCHE, | ||||
0) | 0) | ||||
# Restart the node | # Restart the node | ||||
self.restart_node(0, self.extra_args[0] + [ | self.restart_node(0, self.extra_args[0] + [ | ||||
"-avaproof={}".format(proof), | "-avaproof={}".format(proof), | ||||
Show All 20 Lines |