def signal(self, num_blocks, expected_lockin):
    self.log.info(('Signal with %d/500 blocks' % num_blocks))
    for i in range((500 - num_blocks)):
        test_block = self.create_test_block()
        self.nodes[0].submitblock(ToHex(test_block))
    if (num_blocks > 0):
        for i in range(((num_blocks - 1) // 10)):
            self.bump_mocktime(10)
            self.nodes[0].generate(10)
        self.nodes[0].generate(((num_blocks - 1) % 10))
        assert_equal(get_bip9_status(self.nodes[0], 'realloc')['status'], 'started')
        self.nodes[0].generate(1)
    if expected_lockin:
        assert_equal(get_bip9_status(self.nodes[0], 'realloc')['status'], 'locked_in')
    else:
        assert_equal(get_bip9_status(self.nodes[0], 'realloc')['status'], 'started')
def signal(self, num_blocks, expected_lockin):
    self.log.info(('Signal with %d/500 blocks' % num_blocks))
    for i in range((500 - num_blocks)):
        test_block = self.create_test_block()
        self.nodes[0].submitblock(ToHex(test_block))
    if (num_blocks > 0):
        for i in range(((num_blocks - 1) // 10)):
            self.bump_mocktime(10)
            self.nodes[0].generate(10)
        self.nodes[0].generate(((num_blocks - 1) % 10))
        assert_equal(get_bip9_status(self.nodes[0], 'realloc')['status'], 'started')
        self.nodes[0].generate(1)
    if expected_lockin:
        assert_equal(get_bip9_status(self.nodes[0], 'realloc')['status'], 'locked_in')
    else:
        assert_equal(get_bip9_status(self.nodes[0], 'realloc')['status'], 'started')