Skip to content

Commit

Permalink
test: pep-8 p2p_feefilter.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoFalke committed Jun 21, 2020
1 parent 4b5c919 commit fab83b9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/functional/p2p_feefilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
def hashToHex(hash):
return format(hash, '064x')


# 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):
Expand All @@ -24,6 +25,7 @@ def allInvsMatch(invsExpected, testnode):
time.sleep(1)
return False


class TestP2PConn(P2PInterface):
def __init__(self):
super().__init__()
Expand All @@ -38,6 +40,7 @@ def clear_invs(self):
with mininode_lock:
self.txinvs = []


class FeeFilterTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
Expand All @@ -46,7 +49,7 @@ def set_test_params(self):
# mempool and wallet feerate calculation based on GetFee
# rounding down 3 places, leading to stranded transactions.
# See issue #16499
self.extra_args = [["-minrelaytxfee=0.00000100", "-mintxfee=0.00000100"]]*self.num_nodes
self.extra_args = [["-minrelaytxfee=0.00000100", "-mintxfee=0.00000100"]] * self.num_nodes

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down Expand Up @@ -80,7 +83,7 @@ def run_test(self):
# by the test connection
node1.settxfee(Decimal("0.00000100"))
[node1.sendtoaddress(node1.getnewaddress(), 1) for x in range(3)]
self.sync_mempools() # must be sure node 0 has received all txs
self.sync_mempools() # must be sure node 0 has received all txs

# Send one transaction from node0 that should be received, so that we
# we can sync the test on receipt (if node1's txs were relayed, they'd
Expand All @@ -100,5 +103,6 @@ def run_test(self):
assert allInvsMatch(txids, self.nodes[0].p2p)
self.nodes[0].p2p.clear_invs()


if __name__ == '__main__':
FeeFilterTest().main()

0 comments on commit fab83b9

Please sign in to comment.