g_fs_transaction_handler_status g_fs_transaction_handler_discovery::finish_transaction(g_thread* thread, g_fs_delegate* delegate) {

	// if not all nodes have been discovered yet, we need to do a loop
	if (!all_nodes_discovered) {

		// allow the delegate to finish
		if (delegate) {
			delegate->finish_discovery(thread, this);
		}

		// if discovering the next node was successful, go on with discovering
		if (status == G_FS_DISCOVERY_SUCCESSFUL) {

			bool entire_path_discovered = g_filesystem::discover_absolute_path(thread, absolute_path, this);
			if (!entire_path_discovered) {
				return G_FS_TRANSACTION_HANDLING_KEEP_WAITING;
			}
		}
	}

	// when everything is done, perform afterwork; might want to keep waiting again
	return perform_afterwork(thread);
}
g_fs_transaction_handler_finish_status g_fs_transaction_handler_get_length::finish_transaction(g_thread* thread, g_fs_delegate* delegate) {
	delegate->finish_get_length(thread, this);

	perform_afterwork(thread);
	return G_FS_TRANSACTION_HANDLING_DONE;
}