forked from Qortal/qortal
Fix off-by-one in some sync cases
This commit is contained in:
parent
02966bf39a
commit
d8dd71ff50
@ -345,7 +345,7 @@ public class Synchronizer {
|
|||||||
List<byte[]> peerBlockSignatures = peerBlockSummaries.stream().map(BlockSummaryData::getSignature).collect(Collectors.toList());
|
List<byte[]> peerBlockSignatures = peerBlockSummaries.stream().map(BlockSummaryData::getSignature).collect(Collectors.toList());
|
||||||
|
|
||||||
// Fetch remaining block signatures, if needed
|
// Fetch remaining block signatures, if needed
|
||||||
int numberSignaturesRequired = peerBlockSignatures.size() - (peerHeight - commonBlockHeight - 1);
|
int numberSignaturesRequired = peerBlockSignatures.size() - (peerHeight - commonBlockHeight);
|
||||||
if (numberSignaturesRequired > 0) {
|
if (numberSignaturesRequired > 0) {
|
||||||
byte[] latestPeerSignature = peerBlockSignatures.isEmpty() ? commonBlockSig : peerBlockSignatures.get(peerBlockSignatures.size() - 1);
|
byte[] latestPeerSignature = peerBlockSignatures.isEmpty() ? commonBlockSig : peerBlockSignatures.get(peerBlockSignatures.size() - 1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user