Skip to main content
Checks if a compiled transaction’s recent_blockhash has aged out. Solana transactions expire approximately 150 slots (~2 minutes on mainnet) after their blockhash was created. An expired transaction cannot be submitted — it must be recompiled.
If is_expired is true, call CompileTransaction again to get a fresh blockhash. Expiry cannot be recovered — the existing compiled transaction bytes must be discarded.

Request

transaction
Transaction (object)
required
Transaction to check (must be in COMPILED or later state).
commitment_level
CommitmentLevel (enum)
Optional. Commitment level for blockhash freshness check. Defaults to CONFIRMED.
commitment_level is optional. When omitted or set to COMMITMENT_LEVEL_UNSPECIFIED, the service defaults to COMMITMENT_LEVEL_CONFIRMED. See CommitmentLevel for trade-offs between processed, confirmed, and finalized.

Response

is_expired
bool
True if the transaction’s blockhash has expired and the transaction must be recompiled before submission. False if the blockhash is still fresh.

Code Examples

resp, err := client.CheckIfTransactionIsExpired(ctx, &transaction_v1.CheckIfTransactionIsExpiredRequest{
    Transaction: compiledTxn,
})
if err != nil {
    log.Fatal(err)
}
if resp.IsExpired {
    fmt.Println("Transaction expired — recompile required")
    // call CompileTransaction again
}