Skip to content

Commit

Permalink
fix: add retry blocks to get blockhash for compression actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kespinola committed Oct 12, 2023
1 parent f40ebb8 commit 1484a9e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions consumer/src/solana.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1011,10 +1011,12 @@ impl<'a> TransferBackend<compression_leafs::Model, TransferCompressedMintV1Addre
.data(),
}];

let blockhash = with_retry!(self.0.rpc_client.get_latest_blockhash()).await?;

let serialized_message = solana_program::message::Message::new_with_blockhash(
&instructions,
Some(&payer),
&self.0.rpc_client.get_latest_blockhash().await?,
&blockhash,
)
.serialize();

Expand Down Expand Up @@ -1123,10 +1125,12 @@ impl<'a> MintBackend<MintMetaplexMetadataTransaction, MintCompressedMintV1Addres
.data(),
}];

let blockhash = with_retry!(self.0.rpc_client.get_latest_blockhash()).await?;

let serialized_message = solana_program::message::Message::new_with_blockhash(
&instructions,
Some(&payer),
&self.0.rpc_client.get_latest_blockhash().await?,
&blockhash,
)
.serialize();

Expand Down

0 comments on commit 1484a9e

Please sign in to comment.