Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc_p2p_proof_inventory.py
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | def on_inv(self, message): | ||||
self.proof_invs_counter += 1 | self.proof_invs_counter += 1 | ||||
class ProofInventoryTest(BitcoinTestFramework): | class ProofInventoryTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.num_nodes = 5 | self.num_nodes = 5 | ||||
self.extra_args = [[ | self.extra_args = [[ | ||||
'-enableavalanche=1', | '-enableavalanche=1', | ||||
'-avaproofstakeutxodustthreshold=1000000', | |||||
'-avaproofstakeutxoconfirmations=2', | '-avaproofstakeutxoconfirmations=2', | ||||
'-avacooldown=0', | '-avacooldown=0', | ||||
'-whitelist=noban@127.0.0.1', | '-whitelist=noban@127.0.0.1', | ||||
]] * self.num_nodes | ]] * self.num_nodes | ||||
def generate_proof(self, node, mature=True): | def generate_proof(self, node, mature=True): | ||||
privkey, proof = gen_proof(node) | privkey, proof = gen_proof(node) | ||||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | def test_ban_invalid_proof(self): | ||||
'vout': 0, | 'vout': 0, | ||||
'amount': 10000000, | 'amount': 10000000, | ||||
'height': 42, | 'height': 42, | ||||
'iscoinbase': False, | 'iscoinbase': False, | ||||
'privatekey': privkey, | 'privatekey': privkey, | ||||
}] | }] | ||||
) | ) | ||||
self.restart_node(0, ['-enableavalanche=1']) | self.restart_node( | ||||
0, ['-enableavalanche=1', '-avaproofstakeutxodustthreshold=1000000']) | |||||
peer = node.add_p2p_connection(P2PInterface()) | peer = node.add_p2p_connection(P2PInterface()) | ||||
msg = msg_avaproof() | msg = msg_avaproof() | ||||
# Sending a proof with a missing utxo doesn't trigger a ban | # Sending a proof with a missing utxo doesn't trigger a ban | ||||
msg.proof = avalanche_proof_from_hex(missing_stake) | msg.proof = avalanche_proof_from_hex(missing_stake) | ||||
with node.assert_debug_log(["received: avaproof"], ["Misbehaving"]): | with node.assert_debug_log(["received: avaproof"], ["Misbehaving"]): | ||||
peer.send_message(msg) | peer.send_message(msg) | ||||
▲ Show 20 Lines • Show All 192 Lines • Show Last 20 Lines |