File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -24,11 +24,11 @@ static_assert(sizeof(CompressedHeader) == 48);
24
24
25
25
HeadersSyncState::HeadersSyncState (NodeId id, const Consensus::Params& consensus_params,
26
26
const CBlockIndex* chain_start, const arith_uint256& minimum_required_work) :
27
+ m_commit_offset(GetRand<unsigned >(HEADER_COMMITMENT_PERIOD)),
27
28
m_id(id), m_consensus_params(consensus_params),
28
29
m_chain_start(chain_start),
29
30
m_minimum_required_work(minimum_required_work),
30
31
m_current_chain_work(chain_start->nChainWork),
31
- m_commit_offset(GetRand<unsigned >(HEADER_COMMITMENT_PERIOD)),
32
32
m_last_header_received(m_chain_start->GetBlockHeader ()),
33
33
m_current_height(chain_start->nHeight)
34
34
{
Original file line number Diff line number Diff line change @@ -175,6 +175,13 @@ class HeadersSyncState {
175
175
*/
176
176
CBlockLocator NextHeadersRequestLocator () const ;
177
177
178
+ protected:
179
+ /* * The (secret) offset on the heights for which to create commitments.
180
+ *
181
+ * m_header_commitments entries are created at any height h for which
182
+ * (h % HEADER_COMMITMENT_PERIOD) == m_commit_offset. */
183
+ const unsigned m_commit_offset;
184
+
178
185
private:
179
186
/* * Clear out all download state that might be in progress (freeing any used
180
187
* memory), and mark this object as no longer usable.
@@ -222,12 +229,6 @@ class HeadersSyncState {
222
229
/* * A queue of commitment bits, created during the 1st phase, and verified during the 2nd. */
223
230
bitdeque<> m_header_commitments;
224
231
225
- /* * The (secret) offset on the heights for which to create commitments.
226
- *
227
- * m_header_commitments entries are created at any height h for which
228
- * (h % HEADER_COMMITMENT_PERIOD) == m_commit_offset. */
229
- const unsigned m_commit_offset;
230
-
231
232
/* * m_max_commitments is a bound we calculate on how long an honest peer's chain could be,
232
233
* given the MTP rule.
233
234
*
You can’t perform that action at this time.
0 commit comments