Skip to content

Commit

Permalink
test: Remove confusing cast to same type (int to int)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoFalke committed Sep 28, 2020
1 parent c95784e commit fae243f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/functional/p2p_invalid_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ def test_buffer(self):
conn = self.nodes[0].add_p2p_connection(P2PDataStore())
# Create valid message
msg = conn.build_message(msg_ping(nonce=12345))
cut_pos = 12 # Chosen at an arbitrary position within the header
cut_pos = 12 # Chosen at an arbitrary position within the header
# Send message in two pieces
before = int(self.nodes[0].getnettotals()['totalbytesrecv'])
before = self.nodes[0].getnettotals()['totalbytesrecv']
conn.send_raw_message(msg[:cut_pos])
# Wait until node has processed the first half of the message
self.wait_until(lambda: int(self.nodes[0].getnettotals()['totalbytesrecv']) != before)
middle = int(self.nodes[0].getnettotals()['totalbytesrecv'])
self.wait_until(lambda: self.nodes[0].getnettotals()['totalbytesrecv'] != before)
middle = self.nodes[0].getnettotals()['totalbytesrecv']
# If this assert fails, we've hit an unlikely race
# where the test framework sent a message in between the two halves
assert_equal(middle, before + cut_pos)
Expand Down

0 comments on commit fae243f

Please sign in to comment.