Register the given lockhash with the existing merkle tree.

def compute_merkletree_with(
        merkletree: MerkleTreeState,
        lockhash: LockHash,
) -> Optional[MerkleTreeState]:
    """Register the given lockhash with the existing merkle tree."""
    # Use None to inform the caller the lockshash is already known
    result = None

    leaves = merkletree.layers[LEAVES]
    if lockhash not in leaves:
        leaves = list(leaves)
        leaves.append(Keccak256(lockhash))
        result = MerkleTreeState(compute_layers(leaves))

    return result