mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Merge branch 'inactive-contacts' into 'master'
Don't connect to inactive contacts Two changes: 1. Don't use remote transport properties for contacts that are in the process of being introduced - this avoids wasted connection attempts, as we can't create stream contexts for such contacts. 2. Don't activate contacts when receiving incoming streams - doing so was meant as a workaround for newly introduced contacts having inconsistent views of their introduction status if the introducer was offline. But it just shifted the inconsistency elsewhee, so this change removes the workaround. See merge request !153
This commit is contained in:
@@ -164,6 +164,8 @@ class TransportPropertyManagerImpl implements TransportPropertyManager,
|
||||
Transaction txn = db.startTransaction(true);
|
||||
try {
|
||||
for (Contact c : db.getContacts(txn)) {
|
||||
// Don't return properties for inactive contacts
|
||||
if (!c.isActive()) continue;
|
||||
Group g = getContactGroup(c);
|
||||
// Find the latest remote update
|
||||
LatestUpdate latest = findLatest(txn, g.getId(), t, false);
|
||||
|
||||
@@ -134,9 +134,6 @@ class KeyManagerImpl implements KeyManager, Service, EventListener {
|
||||
Transaction txn = db.startTransaction(false);
|
||||
try {
|
||||
ctx = m.getStreamContext(txn, tag);
|
||||
// Activate the contact if not already active
|
||||
if (ctx != null && !activeContacts.containsKey(ctx.getContactId()))
|
||||
db.setContactActive(txn, ctx.getContactId(), true);
|
||||
txn.setComplete();
|
||||
} finally {
|
||||
db.endTransaction(txn);
|
||||
|
||||
Reference in New Issue
Block a user