[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r2191 - GNUnet/src/applications/gap
From: |
grothoff |
Subject: |
[GNUnet-SVN] r2191 - GNUnet/src/applications/gap |
Date: |
Fri, 14 Oct 2005 05:14:44 -0700 (PDT) |
Author: grothoff
Date: 2005-10-14 05:14:42 -0700 (Fri, 14 Oct 2005)
New Revision: 2191
Modified:
GNUnet/src/applications/gap/gap.c
Log:
fixing 949'
'
Modified: GNUnet/src/applications/gap/gap.c
===================================================================
--- GNUnet/src/applications/gap/gap.c 2005-10-13 20:34:08 UTC (rev 2190)
+++ GNUnet/src/applications/gap/gap.c 2005-10-14 12:14:42 UTC (rev 2191)
@@ -793,8 +793,11 @@
if (distance <= 0)
distance = 1;
ranking += 0xFFFF / (1 + randomi(distance));
- ranking += randomi(0xFF); /* small random chance for everyone */
- qr->rankings[getIndex(id)] = ranking;
+ ranking += 1 + randomi(0xFF); /* small random chance for everyone */
+ if (equalsHashCode512(&id->hashPubKey,
+ &qr->noTarget.hashPubKey))
+ ranking = 0; /* no chance for blocked peers */
+ qr->rankings[getIndex(id)] = ranking;
}
/**
@@ -944,6 +947,9 @@
pos += qr->rankings[j];
if (pos > sel) {
setBit(qr, j);
+ if (rankingSum>qr->rankings[j])
+ rankingSum -= qr->rankings[j];
+ qr->rankings[j] = 0;
break;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r2191 - GNUnet/src/applications/gap,
grothoff <=