[#HeadersSyncState-ProcessNextHeaders]
= xref:HeadersSyncState.adoc[HeadersSyncState]::ProcessNextHeaders
:relfileprefix: ../
:mrdocs:

Process a batch of headers, once a sync via this mechanism has started

== Synopsis

Declared in `&lt;headerssync&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:HeadersSyncState/ProcessingResult.adoc[ProcessingResult]
ProcessNextHeaders(
    std::span&lt;CBlockHeader const&gt; received&lowbar;headers,
    bool full&lowbar;headers&lowbar;message);
----

== Description

received&lowbar;headers&colon; headers that were received over the network for processing&period; Assumes the caller has already verified the headers are continuous, and has checked that each header satisfies the proof&hyphen;of&hyphen;work target included in the header (but not necessarily verified that the proof&hyphen;of&hyphen;work target is correct and passes consensus rules)&period; full&lowbar;headers&lowbar;message&colon; true if the message was at max capacity, indicating more headers may be available ProcessingResult&period;pow&lowbar;validated&lowbar;headers&colon; will be filled in with any headers that the caller can fully process and validate now (because these returned headers are on a chain with sufficient work) ProcessingResult&period;success&colon; set to false if an error is detected and the sync is aborted&semi; true otherwise&period; ProcessingResult&period;request&lowbar;more&colon; if true, the caller is suggested to call NextHeadersRequestLocator and send a getheaders message using it&period;

== Return Value

The processing result, including any headers ready for validation&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *received&lowbar;headers*
| Continuous headers received from the peer to process&period;
| *full&lowbar;headers&lowbar;message*
| True if the message was at max capacity (more may follow)&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
