Changeset View
Changeset View
Standalone View
Standalone View
test/functional/mining_getblocktemplate_longpoll.py
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
assert not thr.is_alive() | assert not thr.is_alive() | ||||
# Test 4: test that introducing a new transaction into the mempool will | # Test 4: test that introducing a new transaction into the mempool will | ||||
# terminate the longpoll | # terminate the longpoll | ||||
thr = LongpollThread(self.nodes[0]) | thr = LongpollThread(self.nodes[0]) | ||||
thr.start() | thr.start() | ||||
# generate a random transaction and submit it | # generate a random transaction and submit it | ||||
min_relay_fee = self.nodes[0].getnetworkinfo()["relayfee"] | min_relay_fee = self.nodes[0].getnetworkinfo()["relayfee"] | ||||
# min_relay_fee is fee per 1000 bytes, which should be more than enough. | # min_relay_fee is fee per 1000 bytes, which should be more than | ||||
# enough. | |||||
(txid, txhex, fee) = random_transaction(self.nodes, | (txid, txhex, fee) = random_transaction(self.nodes, | ||||
Decimal("1.1"), min_relay_fee, Decimal("0.001"), 20) | Decimal("1.1"), min_relay_fee, Decimal("0.001"), 20) | ||||
# after one minute, every 10 seconds the mempool is probed, so in 80 | # after one minute, every 10 seconds the mempool is probed, so in 80 | ||||
# seconds it should have returned | # seconds it should have returned | ||||
thr.join(60 + 20) | thr.join(60 + 20) | ||||
assert not thr.is_alive() | assert not thr.is_alive() | ||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
GetBlockTemplateLPTest().main() | GetBlockTemplateLPTest().main() |