Skip to content
Permalink
Browse files

Merge pull request #567 from earlbread/fix-expected-responses

Fix expectedResponses in GetBlocksAsync
  • Loading branch information...
earlbread committed Oct 8, 2019
2 parents e7ccac6 + 9f1ac42 commit 9885d6f08ea6a249e5318f53a6a35792294d3ba4
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 9885d6f

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