Minor comment re-org

This commit is contained in:
catbref 2021-03-20 11:45:11 +00:00
parent e694a51cdd
commit 019cfdc1db

View File

@ -350,10 +350,12 @@ public class Synchronizer {
// Convert any leftover (post-common) block summaries into signatures to request from peer
List<byte[]> peerBlockSignatures = peerBlockSummaries.stream().map(BlockSummaryData::getSignature).collect(Collectors.toList());
// Fetch remaining block signatures, if needed
int additionalPeerBlocksAfterCommonBlock = peerHeight - commonBlockHeight; // Calculate the total number of additional blocks this peer has beyond the common block
int numberSignaturesRequired = additionalPeerBlocksAfterCommonBlock - peerBlockSignatures.size(); // Subtract the number of signatures that we already have, as we don't need to request them again
// Calculate the total number of additional blocks this peer has beyond the common block
int additionalPeerBlocksAfterCommonBlock = peerHeight - commonBlockHeight;
// Subtract the number of signatures that we already have, as we don't need to request them again
int numberSignaturesRequired = additionalPeerBlocksAfterCommonBlock - peerBlockSignatures.size();
// Fetch remaining block signatures, if needed
if (numberSignaturesRequired > 0) {
byte[] latestPeerSignature = peerBlockSignatures.isEmpty() ? commonBlockSig : peerBlockSignatures.get(peerBlockSignatures.size() - 1);