<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def commit_finished( self, block_id ):
 """ Called when the block is finished. Commits all data. """


        self.db.commit()

        # NOTE: tokens vest for the *next* block in order to make the immediately usable
        assert block_id+1 in self.vesting, 'BUG: failed to vest at {}'.format(block_id)

        self.clear_collisions( block_id )
        self.clear_vesting(block_id+1)