diff --git a/packages/identity/src/identity/delegation.ts b/packages/identity/src/identity/delegation.ts index f450bb5d5..a488a7e17 100644 --- a/packages/identity/src/identity/delegation.ts +++ b/packages/identity/src/identity/delegation.ts @@ -225,8 +225,7 @@ export class DelegationChain { if (usedPublicKeys.has(currentPublicKey)) { throw new DelegationError('Delegation target cannot be repeated in the chain.'); } - usedPublicKeys.add(currentPublicKey); - currentPublicKey = delegation.delegation.pubkey; + usedPublicKeys.add(delegation.delegation.pubkey); } // Ensure that the last public key in the chain not repeated.