Anchor
AccountDiscriminatorMismatch
“Account discriminator did not match what was expected”
The first 8 bytes of the account do not match the expected account type's discriminator.
Common causes
- Passing the wrong kind of account (for example a
Vaultwhere aConfigis expected). - Passing an account created by an older version of the program with a different struct name.
- Passing an uninitialised or empty account where a typed account is expected.
How to fix it
- Check that the address belongs to an account of the right type. If the struct was renamed, migrate or recreate the account.