Skip to content

Commit 710fd57

Browse files
committed
Merge bitcoin/bitcoin#26996: test: Flatten miniwallet array and remove random fee in longpoll
fa0abcd test: Flatten miniwallet array and remove random fee in longpoll (MarcoFalke) Pull request description: * Using a single MiniWallet is enough. * A random fee isn't needed either. ACKs for top commit: theStack: re-ACK fa0abcd Tree-SHA512: 77b99885b3f0d325d067838122114be57ec999ebc82912de6a22c33e2ba28a341c5e053c5bbc424b9922c2616562289a57c7156bd3b431d779182c2e472da59c
2 parents 1ff135c + fa0abcd commit 710fd57

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

test/functional/mining_getblocktemplate_longpoll.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55
"""Test longpolling with getblocktemplate."""
66

7-
from decimal import Decimal
87
import random
98
import threading
109

@@ -47,28 +46,25 @@ def run_test(self):
4746
thr.join(5) # wait 5 seconds or until thread exits
4847
assert thr.is_alive()
4948

50-
miniwallets = [MiniWallet(node) for node in self.nodes]
49+
self.miniwallet = MiniWallet(self.nodes[0])
5150
self.log.info("Test that longpoll will terminate if another node generates a block")
52-
self.generate(miniwallets[1], 1) # generate a block on another node
51+
self.generate(self.nodes[1], 1) # generate a block on another node
5352
# check that thread will exit now that new transaction entered mempool
5453
thr.join(5) # wait 5 seconds or until thread exits
5554
assert not thr.is_alive()
5655

5756
self.log.info("Test that longpoll will terminate if we generate a block ourselves")
5857
thr = LongpollThread(self.nodes[0])
5958
thr.start()
60-
self.generate(miniwallets[0], 1) # generate a block on own node
59+
self.generate(self.nodes[0], 1) # generate a block on own node
6160
thr.join(5) # wait 5 seconds or until thread exits
6261
assert not thr.is_alive()
6362

6463
self.log.info("Test that introducing a new transaction into the mempool will terminate the longpoll")
6564
thr = LongpollThread(self.nodes[0])
6665
thr.start()
67-
# generate a random transaction and submit it
68-
min_relay_fee = self.nodes[0].getnetworkinfo()["relayfee"]
69-
fee_rate = min_relay_fee + Decimal('0.00000010') * random.randint(0,20)
70-
miniwallets[0].send_self_transfer(from_node=random.choice(self.nodes),
71-
fee_rate=fee_rate)
66+
# generate a transaction and submit it
67+
self.miniwallet.send_self_transfer(from_node=random.choice(self.nodes))
7268
# after one minute, every 10 seconds the mempool is probed, so in 80 seconds it should have returned
7369
thr.join(60 + 20)
7470
assert not thr.is_alive()

0 commit comments

Comments
 (0)