Do NOT call finishTrustListImport for EVERY identity:
- Only call it if a duplicate existed.
- Do that for the whole code block which deals with duplicates.
Don't just pretend to take the locks, take them actually:
- restoreOwnIdentity() will do it anyway.
- This will make the function a better capsule because it makes less assumptions about the outer state of WOT.
Add restoreOwnIdentityWithoutCommit() and use it in the database upgrade code:
- Previously restoreOwnIdentity() did its own transaction. This meant that the database upgrade transaction could not be fully rolled back in all cases.