Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions electron/services/WalletService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -855,12 +855,13 @@ export async function executeSwap(
maxRetries: 3,
})

// Confirm the transaction
const latestBlockhash = await connection.getLatestBlockhash()
// Confirm using the blockhash embedded in the transaction by Jupiter
const txBlockhash = transaction.message.recentBlockhash
const { lastValidBlockHeight } = await connection.getLatestBlockhash()
await connection.confirmTransaction({
signature,
blockhash: latestBlockhash.blockhash,
lastValidBlockHeight: latestBlockhash.lastValidBlockHeight,
blockhash: txBlockhash,
lastValidBlockHeight,
})

db.prepare('UPDATE transaction_history SET signature = ?, status = ? WHERE id = ?').run(signature, 'confirmed', txId)
Expand Down