anchor
anchor copied to clipboard
idl: Fix idl write overwrites from retries
Retries caused unnecessary idl writes, even if the tx was succesful. This ended up corrupting the idl, ending up with a wrong IDL/corrupt deflated stream when trying to fetch it.
I moved the blockhash retrieval outside the retry loop, to resend the same tx in case there is a retry, up to the point the blockhash expires. From that point, we refetch the blockhash and resend the tx with a different blockhash