metaplex-foundation / mpl-token-metadata

Program to attach additional data to Fungible or Non-Fungible tokens on Solana.
https://developers.metaplex.com/token-metadata
Other
98 stars 42 forks source link

When I get Metadata of pnfts but got an error about AccountBorrowFailed #118

Open 0xapp123 opened 1 month ago

0xapp123 commented 1 month ago

I tried to get Metadata in mpl-token-metadata 4.1.2.

let nft_metadata = Metadata::safe_deserialize(&mut ctx.accounts.mint_metadata.to_account_info().data.borrow_mut()).unwrap();

And I got this error:

logs: [
    'Program ComputeBudget111111111111111111111111111111 invoke [1]',
    'Program ComputeBudget111111111111111111111111111111 success',
    'Program ComputeBudget111111111111111111111111111111 invoke [1]',
    'Program ComputeBudget111111111111111111111111111111 success',
    'Program 11111111111111111111111111111111 invoke [1]',
    'Program 11111111111111111111111111111111 success',
    'Program HhfZ4hp3MN1uRkY4XGQ21WhfK5RaJtisAgYeqKUsLkZH invoke [1]',
    'Program log: Instruction: InitUser',
    'Program HhfZ4hp3MN1uRkY4XGQ21WhfK5RaJtisAgYeqKUsLkZH consumed 2359 of 599550 compute units',
    'Program HhfZ4hp3MN1uRkY4XGQ21WhfK5RaJtisAgYeqKUsLkZH success',
    'Program HhfZ4hp3MN1uRkY4XGQ21WhfK5RaJtisAgYeqKUsLkZH invoke [1]',
    'Program log: Instruction: LockPnft',
    'Program log: ProgramError occurred. Error Code: AccountBorrowFailed. Error Number: 51539607552. Error Message: Failed to borrow a reference to account data, already borrowed.',
    'Program HhfZ4hp3MN1uRkY4XGQ21WhfK5RaJtisAgYeqKUsLkZH consumed 27326 of 597191 compute units',
    'Program HhfZ4hp3MN1uRkY4XGQ21WhfK5RaJtisAgYeqKUsLkZH failed: instruction tries to borrow reference for an account which is already borrowed'