aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p_feefilter.py
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2020-08-03 01:10:56 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2020-08-06 18:39:33 +0200
commitdac7a111bdd3b0233d94cf68dae7a8bfc6ac9c64 (patch)
treec3ae6f8e52eade778dff7c9ad679a919db22778b /test/functional/p2p_feefilter.py
parent82127d27c9001eee3eb28df67ce2e6eace620423 (diff)
downloadbitcoin-dac7a111bdd3b0233d94cf68dae7a8bfc6ac9c64.tar.xz
refactor: test: use _ variable for unused loop counters
substitutes "for x in range(N):" by "for _ in range(N):" indicates to the reader that a block is just repeated N times, and that the loop counter is not used in the body
Diffstat (limited to 'test/functional/p2p_feefilter.py')
-rwxr-xr-xtest/functional/p2p_feefilter.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/functional/p2p_feefilter.py b/test/functional/p2p_feefilter.py
index 73afe9adc4..0b51d8f4bb 100755
--- a/test/functional/p2p_feefilter.py
+++ b/test/functional/p2p_feefilter.py
@@ -19,7 +19,7 @@ def hashToHex(hash):
# Wait up to 60 secs to see if the testnode has received all the expected invs
def allInvsMatch(invsExpected, testnode):
- for x in range(60):
+ for _ in range(60):
with mininode_lock:
if (sorted(invsExpected) == sorted(testnode.txinvs)):
return True
@@ -91,7 +91,7 @@ class FeeFilterTest(BitcoinTestFramework):
# Test that invs are received by test connection for all txs at
# feerate of .2 sat/byte
node1.settxfee(Decimal("0.00000200"))
- txids = [node1.sendtoaddress(node1.getnewaddress(), 1) for x in range(3)]
+ txids = [node1.sendtoaddress(node1.getnewaddress(), 1) for _ in range(3)]
assert allInvsMatch(txids, conn)
conn.clear_invs()
@@ -100,14 +100,14 @@ class FeeFilterTest(BitcoinTestFramework):
# Test that txs are still being received by test connection (paying .15 sat/byte)
node1.settxfee(Decimal("0.00000150"))
- txids = [node1.sendtoaddress(node1.getnewaddress(), 1) for x in range(3)]
+ txids = [node1.sendtoaddress(node1.getnewaddress(), 1) for _ in range(3)]
assert allInvsMatch(txids, conn)
conn.clear_invs()
# Change tx fee rate to .1 sat/byte and test they are no longer received
# by the test connection
node1.settxfee(Decimal("0.00000100"))
- [node1.sendtoaddress(node1.getnewaddress(), 1) for x in range(3)]
+ [node1.sendtoaddress(node1.getnewaddress(), 1) for _ in range(3)]
self.sync_mempools() # must be sure node 0 has received all txs
# Send one transaction from node0 that should be received, so that we
@@ -124,7 +124,7 @@ class FeeFilterTest(BitcoinTestFramework):
# Remove fee filter and check that txs are received again
conn.send_and_ping(msg_feefilter(0))
- txids = [node1.sendtoaddress(node1.getnewaddress(), 1) for x in range(3)]
+ txids = [node1.sendtoaddress(node1.getnewaddress(), 1) for _ in range(3)]
assert allInvsMatch(txids, conn)
conn.clear_invs()