Changeset View
Changeset View
Standalone View
Standalone View
test/functional/getblocktemplate_longpoll.py
Show All 12 Lines | class LongpollThread(threading.Thread): | ||||
def __init__(self, node): | def __init__(self, node): | ||||
threading.Thread.__init__(self) | threading.Thread.__init__(self) | ||||
# query current longpollid | # query current longpollid | ||||
templat = node.getblocktemplate() | templat = node.getblocktemplate() | ||||
self.longpollid = templat['longpollid'] | self.longpollid = templat['longpollid'] | ||||
# create a new connection to the node, we can't use the same | # create a new connection to the node, we can't use the same | ||||
# connection from two threads | # connection from two threads | ||||
self.node = get_rpc_proxy(node.url, 1, timeout=600) | self.node = get_rpc_proxy( | ||||
node.url, 1, timeout=600, coveragedir=node.coverage_dir) | |||||
def run(self): | def run(self): | ||||
self.node.getblocktemplate({'longpollid': self.longpollid}) | self.node.getblocktemplate({'longpollid': self.longpollid}) | ||||
class GetBlockTemplateLPTest(BitcoinTestFramework): | class GetBlockTemplateLPTest(BitcoinTestFramework): | ||||
''' | ''' | ||||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |