diff --git a/src/sakia/data/processors/identities.py b/src/sakia/data/processors/identities.py index 4e32eae9ed24c0f3305649dd62406d78df9ae299..5967c4c8e18484d6d92e0b31e5ca5fe8ba7de3d9 100644 --- a/src/sakia/data/processors/identities.py +++ b/src/sakia/data/processors/identities.py @@ -106,6 +106,17 @@ class IdentitiesProcessor: signature=uid_data["self"], ) if identity not in identities: + # Search same identity with empty blockstamp (incomplete) + same_with_empty_blockstamp = self._identities_repo.get_one( + currency=identity.currency, + uid=identity.uid, + pubkey=identity.pubkey, + blockstamp=BlockUID.empty() + ) + # Same identity with empty blockstamp (incomplete) should not appears as duplicate + # Beware that identities in block 0 have empty blockstamps ! + if same_with_empty_blockstamp in identities: + identities.remove(same_with_empty_blockstamp) identities.append(identity) break except (errors.DuniterError, asyncio.TimeoutError, ClientError) as e: