Skip to content

Commit

Permalink
Socket Timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
VidereLicet committed Jul 13, 2018
1 parent 1f71793 commit 5d4f6f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/core/block.cpp
Expand Up @@ -944,10 +944,12 @@ namespace Core
mapOrphanBlocksByPrev.insert(make_pair(pblock2->hashPrevBlock, pblock2));

if(pfrom)
{
if (IsInitialBlockDownload())
pfrom->PushGetBlocks(pindexBest, 0);
else
pfrom->AskFor(Net::CInv(Net::MSG_BLOCK, pblock->hashPrevBlock));
}

return true;
}
Expand Down
7 changes: 1 addition & 6 deletions src/net/net.cpp
Expand Up @@ -812,12 +812,7 @@ namespace Net
printf("socket no message in first 60 seconds, %d %d\n", pnode->nLastRecv != 0, pnode->nLastSend != 0);
pnode->fDisconnect = true;
}
else if (GetUnifiedTimestamp() - pnode->nLastSend > 60)
{
printf("socket not sending\n");
pnode->fDisconnect = true;
}
else if (GetUnifiedTimestamp() - pnode->nLastRecv > 60)
else if (GetUnifiedTimestamp() - pnode->nLastSend > 60 && GetUnifiedTimestamp() - pnode->nLastRecv > 60)
{
printf("socket inactivity timeout\n");
pnode->fDisconnect = true;
Expand Down

0 comments on commit 5d4f6f8

Please sign in to comment.