Free any memory in use, and mark this object as no longer usable. This is * required to guarantee that we won't reuse this object with the same * SaltedUint256Hasher for another sync. */
| 49 | * required to guarantee that we won't reuse this object with the same |
| 50 | * SaltedUint256Hasher for another sync. */ |
| 51 | void HeadersSyncState::Finalize() |
| 52 | { |
| 53 | Assume(m_download_state != State::FINAL); |
| 54 | ClearShrink(m_header_commitments); |
| 55 | m_last_header_received.SetNull(); |
| 56 | ClearShrink(m_redownloaded_headers); |
| 57 | m_redownload_buffer_last_hash.SetNull(); |
| 58 | m_redownload_buffer_first_prev_hash.SetNull(); |
| 59 | m_process_all_remaining_headers = false; |
| 60 | m_current_height = 0; |
| 61 | |
| 62 | m_download_state = State::FINAL; |
| 63 | } |
| 64 | |
| 65 | /** Process the next batch of headers received from our peer. |
| 66 | * Validate and store commitments, and compare total chainwork to our target to |
no test coverage detected