def _test_stopatheight(self):
    assert_equal(self.nodes[0].getblockcount(), 200)
    self.nodes[0].generate(6)
    assert_equal(self.nodes[0].getblockcount(), 206)
    self.log.debug('Node should not stop at this height')
    assert_raises(subprocess.TimeoutExpired, (lambda : self.nodes[0].process.wait(timeout=3)))
    try:
        self.nodes[0].generate(1)
    except (ConnectionError, http.client.BadStatusLine):
        pass
    self.log.debug('Node should stop at this height...')
    self.nodes[0].wait_until_stopped()
    self.start_node(0, ['-txindex=0'])
    assert_equal(self.nodes[0].getblockcount(), 207)
def _test_stopatheight(self):
    assert_equal(self.nodes[0].getblockcount(), 200)
    self.nodes[0].generate(6)
    assert_equal(self.nodes[0].getblockcount(), 206)
    self.log.debug('Node should not stop at this height')
    assert_raises(subprocess.TimeoutExpired, (lambda : self.nodes[0].process.wait(timeout=3)))
    try:
        self.nodes[0].generate(1)
    except (ConnectionError, http.client.BadStatusLine):
        pass
    self.log.debug('Node should stop at this height...')
    self.nodes[0].wait_until_stopped()
    self.start_node(0, ['-txindex=0'])
    assert_equal(self.nodes[0].getblockcount(), 207)