Make ProcessNextHeaders use the headers argument as in/out

This allows reusing the same vector storage for input and output headers to
HeadersSync::ProcessNextHeaders. It's also natural in the sense that this argument
just represents the headers-to-be-processed, both in the caller and the callee, and
both before and after the calls.
This commit is contained in:
Pieter Wuille
2022-08-23 17:29:37 -04:00
parent fa5c224d44
commit 4e7ac7b94d
4 changed files with 38 additions and 40 deletions

View File

@@ -2514,12 +2514,6 @@ bool PeerManagerImpl::IsContinuationOfLowWorkHeadersSync(Peer& peer, CNode& pfro
}
}
if (result.success) {
// We only overwrite the headers passed in if processing was
// successful.
headers.swap(result.pow_validated_headers);
}
return result.success;
}
// Either we didn't have a sync in progress, or something went wrong