Skip to content
Permalink
Browse files

Fix expectedResponses in GetBlocksAsync

[changelog skip]
  • Loading branch information...
earlbread committed Oct 8, 2019
1 parent e7ccac6 commit 9f1ac42e86552cc22b56f8a7d888b6c944cbb2cb
Showing with 7 additions and 1 deletion.
  1. +7 −1 Libplanet/Net/Swarm.cs
@@ -919,11 +919,17 @@ internal async Task SendMessageAsync(BoundPeer peer, Message message)
blockHashes.ToArray();
var request = new GetBlocks(blockHashesAsArray);
int hashCount = blockHashesAsArray.Count();

if (hashCount < 1)
{
yield.Break();
}

IEnumerable<Message> replies = await SendMessageWithReplyAsync(
peer,
request,
BlockRecvTimeout,
(hashCount / request.ChunkSize) + 1,
((hashCount - 1) / request.ChunkSize) + 1,
yieldToken
);

0 comments on commit 9f1ac42

Please sign in to comment.
You can’t perform that action at this time.