0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-02 09:46:52 -05:00

test: Remove confusing cast to same type (int to int)

This commit is contained in:
MarcoFalke 2020-09-28 10:21:16 +02:00
parent c95784e3d3
commit fae243f0cb
No known key found for this signature in database
GPG key ID: CE2B75697E69A548

View file

@ -66,11 +66,11 @@ class InvalidMessagesTest(BitcoinTestFramework):
msg = conn.build_message(msg_ping(nonce=12345))
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)