aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2014-01-10 13:23:26 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2014-02-08 16:52:19 +0100
commitf59d8f0b644d49324cabd19c58cf2262d49e1392 (patch)
treeb699fa0e1f6a0ca3fc09ef0ef50c4f30a6ad5b9c /src/net.h
parent95e66247ebaac88dadd081f850ebf86c71831e61 (diff)
Per-peer block download tracking and stalled download detection.
Keep track of which block is being requested (and to be requested) from each peer, and limit the number of blocks in-flight per peer. In addition, detect stalled downloads, and disconnect if they persist for too long. This means blocks are never requested twice, and should eliminate duplicate downloads during synchronization.
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net.h b/src/net.h
index a181e275ca..0307a0ccb2 100644
--- a/src/net.h
+++ b/src/net.h
@@ -427,7 +427,7 @@ public:
LogPrint("net", "askfor %s %"PRId64" (%s)\n", inv.ToString().c_str(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str());
// Make sure not to reuse time indexes to keep things in the same order
- int64_t nNow = (GetTime() - 1) * 1000000;
+ int64_t nNow = GetTimeMicros() - 1000000;
static int64_t nLastTime;
++nLastTime;
nNow = std::max(nNow, nLastTime);