diff --git a/briar-api/src/org/briarproject/api/properties/TransportPropertyManager.java b/briar-api/src/org/briarproject/api/properties/TransportPropertyManager.java index 9dc655543950ec88500749ffc6c0d68c177d0cb9..445329ba95a6100c1def5d4a9f87363c5b3a3f94 100644 --- a/briar-api/src/org/briarproject/api/properties/TransportPropertyManager.java +++ b/briar-api/src/org/briarproject/api/properties/TransportPropertyManager.java @@ -4,6 +4,7 @@ import org.briarproject.api.DeviceId; import org.briarproject.api.TransportId; import org.briarproject.api.contact.ContactId; import org.briarproject.api.db.DbException; +import org.briarproject.api.db.Transaction; import java.util.Map; @@ -13,7 +14,7 @@ public interface TransportPropertyManager { * Stores the given properties received while adding a contact - they will * be superseded by any properties synced from the contact. */ - void addRemoteProperties(ContactId c, DeviceId dev, + void addRemoteProperties(Transaction txn, ContactId c, DeviceId dev, Map<TransportId, TransportProperties> props) throws DbException; /** Returns the local transport properties for all transports. */ diff --git a/briar-core/src/org/briarproject/properties/TransportPropertyManagerImpl.java b/briar-core/src/org/briarproject/properties/TransportPropertyManagerImpl.java index 9910ff42fe9facb2d1a0a5eebebff2cc89b1f6da..4b10c48edeef1b79ea322826b2e3661bd3d7f32b 100644 --- a/briar-core/src/org/briarproject/properties/TransportPropertyManagerImpl.java +++ b/briar-core/src/org/briarproject/properties/TransportPropertyManagerImpl.java @@ -82,18 +82,12 @@ class TransportPropertyManagerImpl implements TransportPropertyManager, } @Override - public void addRemoteProperties(ContactId c, DeviceId dev, + public void addRemoteProperties(Transaction txn, ContactId c, DeviceId dev, Map<TransportId, TransportProperties> props) throws DbException { - Transaction txn = db.startTransaction(false); - try { - Group g = getContactGroup(db.getContact(txn, c)); - for (Entry<TransportId, TransportProperties> e : props.entrySet()) { - storeMessage(txn, g.getId(), dev, e.getKey(), e.getValue(), 0, - false, false); - } - txn.setComplete(); - } finally { - db.endTransaction(txn); + Group g = getContactGroup(db.getContact(txn, c)); + for (Entry<TransportId, TransportProperties> e : props.entrySet()) { + storeMessage(txn, g.getId(), dev, e.getKey(), e.getValue(), 0, + false, false); } }