mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 05:09:53 +01:00
Don't make empty offers.
This commit is contained in:
@@ -714,6 +714,7 @@ DatabaseCleaner.Callback {
|
|||||||
} finally {
|
} finally {
|
||||||
contactLock.readLock().unlock();
|
contactLock.readLock().unlock();
|
||||||
}
|
}
|
||||||
|
if(offered.isEmpty()) return null;
|
||||||
return new Offer(offered);
|
return new Offer(offered);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1369,7 +1370,10 @@ DatabaseCleaner.Callback {
|
|||||||
throw new NoSuchTransportException();
|
throw new NoSuchTransportException();
|
||||||
long counter = db.incrementConnectionCounter(txn, c, t,
|
long counter = db.incrementConnectionCounter(txn, c, t,
|
||||||
period);
|
period);
|
||||||
db.setLastConnected(txn, c, clock.currentTimeMillis());
|
if(counter != -1) {
|
||||||
|
long now = clock.currentTimeMillis();
|
||||||
|
db.setLastConnected(txn, c, now);
|
||||||
|
}
|
||||||
db.commitTransaction(txn);
|
db.commitTransaction(txn);
|
||||||
return counter;
|
return counter;
|
||||||
} catch(DbException e) {
|
} catch(DbException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user