forked from Qortal/qortal
Fixed Synchronizer.getBlockSummaries() which was expecting BLOCK_SUMMARIES, but updated peers send BLOCK_SUMMARIES_V2
This commit is contained in:
parent
7a60f713ea
commit
d2ebb215e6
@ -1553,13 +1553,20 @@ public class Synchronizer extends Thread {
|
|||||||
Message getBlockSummariesMessage = new GetBlockSummariesMessage(parentSignature, numberRequested);
|
Message getBlockSummariesMessage = new GetBlockSummariesMessage(parentSignature, numberRequested);
|
||||||
|
|
||||||
Message message = peer.getResponse(getBlockSummariesMessage);
|
Message message = peer.getResponse(getBlockSummariesMessage);
|
||||||
if (message == null || message.getType() != MessageType.BLOCK_SUMMARIES)
|
if (message == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if (message.getType() == MessageType.BLOCK_SUMMARIES) {
|
||||||
BlockSummariesMessage blockSummariesMessage = (BlockSummariesMessage) message;
|
BlockSummariesMessage blockSummariesMessage = (BlockSummariesMessage) message;
|
||||||
|
|
||||||
return blockSummariesMessage.getBlockSummaries();
|
return blockSummariesMessage.getBlockSummaries();
|
||||||
}
|
}
|
||||||
|
else if (message.getType() == MessageType.BLOCK_SUMMARIES_V2) {
|
||||||
|
BlockSummariesV2Message blockSummariesMessage = (BlockSummariesV2Message) message;
|
||||||
|
return blockSummariesMessage.getBlockSummaries();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private List<byte[]> getBlockSignatures(Peer peer, byte[] parentSignature, int numberRequested) throws InterruptedException {
|
private List<byte[]> getBlockSignatures(Peer peer, byte[] parentSignature, int numberRequested) throws InterruptedException {
|
||||||
Message getSignaturesMessage = new GetSignaturesV2Message(parentSignature, numberRequested);
|
Message getSignaturesMessage = new GetSignaturesV2Message(parentSignature, numberRequested);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user