Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
252/** Store the latest header received while in PRESYNC (initialized to m_chain_start) */253CBlockHeader m_last_header_received;255/** Height of m_last_header_received */256int64_t m_current_height{0};258/** During phase 2 (REDOWNLOAD), we buffer redownloaded headers in memory259* until enough commitments have been verified; those are stored in260* m_redownloaded_headers */261std::deque<CompressedHeader> m_redownloaded_headers;263/** Height of last header in m_redownloaded_headers */264int64_t m_redownload_buffer_last_height{0};266/** Hash of last header in m_redownloaded_headers (initialized to267* m_chain_start). We have to cache it because we don't have hashPrevBlock268* available in a CompressedHeader.269*/270uint256 m_redownload_buffer_last_hash;272/** The hashPrevBlock entry for the first header in m_redownloaded_headers273* We need this to reconstruct the full header when it's time for274* processing.275*/276uint256 m_redownload_buffer_first_prev_hash;278/** The accumulated work on the redownloaded chain. */279arith_uint256 m_redownload_chain_work;281/** Set this to true once we encounter the target blockheader during phase282* 2 (REDOWNLOAD). At this point, we can process and store all remaining283* headers still in m_redownloaded_headers.284*/285bool m_process_all_remaining_headers{false};287/** Current state of our headers sync. */288State m_download_state{State::PRESYNC};289};291#endif // BITCOIN_HEADERSSYNC_H
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.