Changeset View
Changeset View
Standalone View
Standalone View
qa/rpc-tests/getblocktemplate_longpoll.py
Show All 30 Lines | class GetBlockTemplateLPTest(BitcoinTestFramework): | ||||
''' | ''' | ||||
def __init__(self): | def __init__(self): | ||||
super().__init__() | super().__init__() | ||||
self.num_nodes = 4 | self.num_nodes = 4 | ||||
self.setup_clean_chain = False | self.setup_clean_chain = False | ||||
def run_test(self): | def run_test(self): | ||||
print( | self.log.info( | ||||
"Warning: this test will take about 70 seconds in the best case. Be patient.") | "Warning: this test will take about 70 seconds in the best case. Be patient.") | ||||
self.nodes[0].generate(10) | self.nodes[0].generate(10) | ||||
templat = self.nodes[0].getblocktemplate() | templat = self.nodes[0].getblocktemplate() | ||||
longpollid = templat['longpollid'] | longpollid = templat['longpollid'] | ||||
# longpollid should not change between successive invocations if | # longpollid should not change between successive invocations if | ||||
# nothing else happens | # nothing else happens | ||||
templat2 = self.nodes[0].getblocktemplate() | templat2 = self.nodes[0].getblocktemplate() | ||||
assert(templat2['longpollid'] == longpollid) | assert(templat2['longpollid'] == longpollid) | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |