[#index_util-CopyHeightIndexToHashIndex] = xref:index_util.adoc[index_util]::CopyHeightIndexToHashIndex :relfileprefix: ../ :mrdocs: Copy an index entry from the height index to the hash index. == Synopsis Declared in `<index/db_key.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename DBVal> [[nodiscard]] static bool CopyHeightIndexToHashIndex( xref:CDBIterator.adoc[CDBIterator]& db_it, xref:CDBBatch.adoc[CDBBatch]& batch, std::string const& index_name, int height); ---- == Description Used during a reorg so entries for blocks no longer on the main chain remain queryable by hash. == Return Value True on success, false if the expected entry could not be read. [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Template Parameters [cols="1,4"] |=== | Name| Description | *DBVal* | Type of the value stored for the entry. |=== == Parameters [cols="1,4"] |=== | Name| Description | *db_it* | Iterator positioned to read the height‐indexed entry. | *batch* | Write batch that the hash‐indexed copy is added to. | *index_name* | Name of the index, used for error logging. | *height* | Block height of the entry to copy. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#