@@ -42,7 +42,7 @@ HeadersSyncState::HeadersSyncState(NodeId id, const Consensus::Params& consensus
42
42
// could try again, if necessary, to sync a longer chain).
43
43
m_max_commitments = 6 *(Ticks<std::chrono::seconds>(GetAdjustedTime () - NodeSeconds{std::chrono::seconds{chain_start->GetMedianTimePast ()}}) + MAX_FUTURE_BLOCK_TIME) / HEADER_COMMITMENT_PERIOD;
44
44
45
- LogPrint (BCLog::HEADERSSYNC , " Initial headers sync started with peer=%d: height=%i, max_commitments=%i, min_work=%s\n " , m_id, m_current_height, m_max_commitments, m_minimum_required_work.ToString ());
45
+ LogPrint (BCLog::NET , " Initial headers sync started with peer=%d: height=%i, max_commitments=%i, min_work=%s\n " , m_id, m_current_height, m_max_commitments, m_minimum_required_work.ToString ());
46
46
}
47
47
48
48
/* * Free any memory in use, and mark this object as no longer usable. This is
@@ -92,7 +92,7 @@ HeadersSyncState::ProcessingResult HeadersSyncState::ProcessNextHeaders(const
92
92
// If we're in PRESYNC and we get a non-full headers
93
93
// message, then the peer's chain has ended and definitely doesn't
94
94
// have enough work, so we can stop our sync.
95
- LogPrint (BCLog::HEADERSSYNC , " Initial headers sync aborted with peer=%d: incomplete headers message at height=%i (presync phase)\n " , m_id, m_current_height);
95
+ LogPrint (BCLog::NET , " Initial headers sync aborted with peer=%d: incomplete headers message at height=%i (presync phase)\n " , m_id, m_current_height);
96
96
}
97
97
}
98
98
} else if (m_download_state == State::REDOWNLOAD) {
@@ -118,7 +118,7 @@ HeadersSyncState::ProcessingResult HeadersSyncState::ProcessNextHeaders(const
118
118
// If we hit our target blockhash, then all remaining headers will be
119
119
// returned and we can clear any leftover internal state.
120
120
if (m_redownloaded_headers.empty () && m_process_all_remaining_headers) {
121
- LogPrint (BCLog::HEADERSSYNC , " Initial headers sync complete with peer=%d: releasing all at height=%i (redownload phase)\n " , m_id, m_redownload_buffer_last_height);
121
+ LogPrint (BCLog::NET , " Initial headers sync complete with peer=%d: releasing all at height=%i (redownload phase)\n " , m_id, m_redownload_buffer_last_height);
122
122
} else if (full_headers_message) {
123
123
// If the headers message is full, we need to request more.
124
124
ret.request_more = true ;
@@ -127,7 +127,7 @@ HeadersSyncState::ProcessingResult HeadersSyncState::ProcessNextHeaders(const
127
127
// declining to serve us that full chain again. Give up.
128
128
// Note that there's no more processing to be done with these
129
129
// headers, so we can still return success.
130
- LogPrint (BCLog::HEADERSSYNC , " Initial headers sync aborted with peer=%d: incomplete headers message at height=%i (redownload phase)\n " , m_id, m_redownload_buffer_last_height);
130
+ LogPrint (BCLog::NET , " Initial headers sync aborted with peer=%d: incomplete headers message at height=%i (redownload phase)\n " , m_id, m_redownload_buffer_last_height);
131
131
}
132
132
}
133
133
}
@@ -150,7 +150,7 @@ bool HeadersSyncState::ValidateAndStoreHeadersCommitments(const std::vector<CBlo
150
150
// This might be benign -- perhaps our peer reorged away from the chain
151
151
// they were on. Give up on this sync for now (likely we will start a
152
152
// new sync with a new starting point).
153
- LogPrint (BCLog::HEADERSSYNC , " Initial headers sync aborted with peer=%d: non-continuous headers at height=%i (presync phase)\n " , m_id, m_current_height);
153
+ LogPrint (BCLog::NET , " Initial headers sync aborted with peer=%d: non-continuous headers at height=%i (presync phase)\n " , m_id, m_current_height);
154
154
return false ;
155
155
}
156
156
@@ -169,7 +169,7 @@ bool HeadersSyncState::ValidateAndStoreHeadersCommitments(const std::vector<CBlo
169
169
m_redownload_buffer_last_hash = m_chain_start->GetBlockHash ();
170
170
m_redownload_chain_work = m_chain_start->nChainWork ;
171
171
m_download_state = State::REDOWNLOAD;
172
- LogPrint (BCLog::HEADERSSYNC , " Initial headers sync transition with peer=%d: reached sufficient work at height=%i, redownloading from height=%i\n " , m_id, m_current_height, m_redownload_buffer_last_height);
172
+ LogPrint (BCLog::NET , " Initial headers sync transition with peer=%d: reached sufficient work at height=%i, redownloading from height=%i\n " , m_id, m_current_height, m_redownload_buffer_last_height);
173
173
}
174
174
return true ;
175
175
}
@@ -188,7 +188,7 @@ bool HeadersSyncState::ValidateAndProcessSingleHeader(const CBlockHeader& curren
188
188
// adjustment maximum.
189
189
if (!PermittedDifficultyTransition (m_consensus_params, next_height,
190
190
m_last_header_received.nBits , current.nBits )) {
191
- LogPrint (BCLog::HEADERSSYNC , " Initial headers sync aborted with peer=%d: invalid difficulty transition at height=%i (presync phase)\n " , m_id, next_height);
191
+ LogPrint (BCLog::NET , " Initial headers sync aborted with peer=%d: invalid difficulty transition at height=%i (presync phase)\n " , m_id, next_height);
192
192
return false ;
193
193
}
194
194
@@ -200,7 +200,7 @@ bool HeadersSyncState::ValidateAndProcessSingleHeader(const CBlockHeader& curren
200
200
// It's possible the chain grew since we started the sync; so
201
201
// potentially we could succeed in syncing the peer's chain if we
202
202
// try again later.
203
- LogPrint (BCLog::HEADERSSYNC , " Initial headers sync aborted with peer=%d: exceeded max commitments at height=%i (presync phase)\n " , m_id, next_height);
203
+ LogPrint (BCLog::NET , " Initial headers sync aborted with peer=%d: exceeded max commitments at height=%i (presync phase)\n " , m_id, next_height);
204
204
return false ;
205
205
}
206
206
}
@@ -222,7 +222,7 @@ bool HeadersSyncState::ValidateAndStoreRedownloadedHeader(const CBlockHeader& he
222
222
// Ensure that we're working on a header that connects to the chain we're
223
223
// downloading.
224
224
if (header.hashPrevBlock != m_redownload_buffer_last_hash) {
225
- LogPrint (BCLog::HEADERSSYNC , " Initial headers sync aborted with peer=%d: non-continuous headers at height=%i (redownload phase)\n " , m_id, next_height);
225
+ LogPrint (BCLog::NET , " Initial headers sync aborted with peer=%d: non-continuous headers at height=%i (redownload phase)\n " , m_id, next_height);
226
226
return false ;
227
227
}
228
228
@@ -236,7 +236,7 @@ bool HeadersSyncState::ValidateAndStoreRedownloadedHeader(const CBlockHeader& he
236
236
237
237
if (!PermittedDifficultyTransition (m_consensus_params, next_height,
238
238
previous_nBits, header.nBits )) {
239
- LogPrint (BCLog::HEADERSSYNC , " Initial headers sync aborted with peer=%d: invalid difficulty transition at height=%i (redownload phase)\n " , m_id, next_height);
239
+ LogPrint (BCLog::NET , " Initial headers sync aborted with peer=%d: invalid difficulty transition at height=%i (redownload phase)\n " , m_id, next_height);
240
240
return false ;
241
241
}
242
242
@@ -255,7 +255,7 @@ bool HeadersSyncState::ValidateAndStoreRedownloadedHeader(const CBlockHeader& he
255
255
// target blockhash just because we ran out of commitments.
256
256
if (!m_process_all_remaining_headers && next_height % HEADER_COMMITMENT_PERIOD == m_commit_offset) {
257
257
if (m_header_commitments.size () == 0 ) {
258
- LogPrint (BCLog::HEADERSSYNC , " Initial headers sync aborted with peer=%d: commitment overrun at height=%i (redownload phase)\n " , m_id, next_height);
258
+ LogPrint (BCLog::NET , " Initial headers sync aborted with peer=%d: commitment overrun at height=%i (redownload phase)\n " , m_id, next_height);
259
259
// Somehow our peer managed to feed us a different chain and
260
260
// we've run out of commitments.
261
261
return false ;
@@ -264,7 +264,7 @@ bool HeadersSyncState::ValidateAndStoreRedownloadedHeader(const CBlockHeader& he
264
264
bool expected_commitment = m_header_commitments.front ();
265
265
m_header_commitments.pop_front ();
266
266
if (commitment != expected_commitment) {
267
- LogPrint (BCLog::HEADERSSYNC , " Initial headers sync aborted with peer=%d: commitment mismatch at height=%i (redownload phase)\n " , m_id, next_height);
267
+ LogPrint (BCLog::NET , " Initial headers sync aborted with peer=%d: commitment mismatch at height=%i (redownload phase)\n " , m_id, next_height);
268
268
return false ;
269
269
}
270
270
}
0 commit comments