Browse Source

Minor comment re-org

blockminter-updates
catbref 4 years ago
parent
commit
019cfdc1db
  1. 8
      src/main/java/org/qortal/controller/Synchronizer.java

8
src/main/java/org/qortal/controller/Synchronizer.java

@ -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);

Loading…
Cancel
Save