I would like to create a PDA and close it in the same method, but can't find how.
if i use init
and close
, it says i should add mut
, but if i add mut
, it says it can't be used with init
.
Why do i need to create and close the account in the same method ? this account is used in a CPI to receive funds and then send them back to other accounts.
The only solution i can see is creating this account in another method before calling this one, but if i can avoid it, that would be wonderfull.