Introduce separate 'generate' RPC call

This commit is contained in:
Pieter Wuille
2015-03-31 20:28:28 -07:00
parent 0df67f1f7a
commit 6b04508e37
25 changed files with 162 additions and 142 deletions

View File

@@ -51,7 +51,7 @@ class GetBlockTemplateLPTest(BitcoinTestFramework):
def run_test(self):
print "Warning: this test will take about 70 seconds in the best case. Be patient."
self.nodes[0].setgenerate(True, 10)
self.nodes[0].generate(10)
templat = self.nodes[0].getblocktemplate()
longpollid = templat['longpollid']
# longpollid should not change between successive invocations if nothing else happens
@@ -66,7 +66,7 @@ class GetBlockTemplateLPTest(BitcoinTestFramework):
assert(thr.is_alive())
# Test 2: test that longpoll will terminate if another node generates a block
self.nodes[1].setgenerate(True, 1) # generate a block on another node
self.nodes[1].generate(1) # generate a block on another node
# check that thread will exit now that new transaction entered mempool
thr.join(5) # wait 5 seconds or until thread exits
assert(not thr.is_alive())
@@ -74,7 +74,7 @@ class GetBlockTemplateLPTest(BitcoinTestFramework):
# Test 3: test that longpoll will terminate if we generate a block ourselves
thr = LongpollThread(self.nodes[0])
thr.start()
self.nodes[0].setgenerate(True, 1) # generate a block on another node
self.nodes[0].generate(1) # generate a block on another node
thr.join(5) # wait 5 seconds or until thread exits
assert(not thr.is_alive())