<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def verify_database(trusted_consensus_hash, consensus_block_height, untrusted_working_dir, trusted_working_dir, start_block=None, expected_snapshots={}):
 """ Verify that a database is consistent with a known-good consensus hash. Return True if valid. Return False if not """

    db = BlockstackDB.get_readwrite_instance(trusted_working_dir)
    consensus_impl = virtualchain_hooks
    return virtualchain.state_engine_verify(trusted_consensus_hash, consensus_block_height, consensus_impl, untrusted_working_dir, db, start_block=start_block, expected_snapshots=expected_snapshots)