Skip to content

Commit

Permalink
Fix p2p_mutated_blocks.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil committed Oct 27, 2024
1 parent c92a3a5 commit 4cc416e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/functional/p2p_mutated_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def self_transfer_requested():
# Block at height 101 should be the only one in flight from peer 0
peer_info_prior_to_attack = self.nodes[0].getpeerinfo()
assert_equal(peer_info_prior_to_attack[0]['id'], 0)
assert_equal([101], peer_info_prior_to_attack[0]["inflight"])
assert_equal([2001], peer_info_prior_to_attack[0]["inflight"])

# Attempt to clear the honest relayer's download request by sending the
# mutated block (as the attacker).
Expand All @@ -88,7 +88,7 @@ def self_transfer_requested():
# peer 0
peer_info_after_attack = self.nodes[0].getpeerinfo()
assert_equal(peer_info_after_attack[0]['id'], 0)
assert_equal([101], peer_info_after_attack[0]["inflight"])
assert_equal([2001], peer_info_after_attack[0]["inflight"])

# The honest relayer should be able to complete relaying the block by
# sending the blocktxn that was requested.
Expand All @@ -107,7 +107,7 @@ def self_transfer_requested():
# Attacker gets a DoS score of 10, not immediately disconnected, so we do it 10 times to get to 100
for _ in range(10):
assert_equal(len(self.nodes[0].getpeerinfo()), 2)
with self.nodes[0].assert_debug_log(expected_msgs=["AcceptBlock FAILED (prev-blk-not-found)"]):
with self.nodes[0].assert_debug_log(expected_msgs=["has prev block not found"]):
attacker.send_message(msg_block(block_missing_prev))
attacker.wait_for_disconnect(timeout=5)

Expand Down

0 comments on commit 4cc416e

Please sign in to comment.