revert: Remove Alchemy fallback causing crashes
- getFallbackConnection() code was causing execute endpoint to crash - Reverting to Helius-only configuration - Need to investigate root cause before re-adding fallback
This commit is contained in:
@@ -146,16 +146,8 @@ export async function openPosition(
|
||||
console.log(`📝 Transaction submitted: ${txSig}`)
|
||||
|
||||
// CRITICAL: Confirm transaction actually executed on-chain
|
||||
// Use Alchemy (fallback RPC) for confirmation - higher throughput
|
||||
console.log('⏳ Confirming transaction on-chain (using Alchemy for high throughput)...')
|
||||
const alchemyConnection = driftService.getFallbackConnection()
|
||||
const connection = alchemyConnection || driftService.getConnection()
|
||||
|
||||
if (alchemyConnection) {
|
||||
console.log('✅ Using Alchemy RPC for transaction confirmation')
|
||||
} else {
|
||||
console.log('⚠️ No fallback RPC available, using primary RPC')
|
||||
}
|
||||
console.log('⏳ Confirming transaction on-chain...')
|
||||
const connection = driftService.getConnection()
|
||||
|
||||
try {
|
||||
const confirmation = await connection.confirmTransaction(txSig, 'confirmed')
|
||||
@@ -565,16 +557,9 @@ export async function closePosition(
|
||||
console.log(`✅ Close order placed! Transaction: ${txSig}`)
|
||||
|
||||
// CRITICAL: Confirm transaction on-chain to prevent phantom closes
|
||||
// Use Alchemy (fallback RPC) for confirmation - higher throughput
|
||||
console.log('⏳ Confirming transaction on-chain (using Alchemy, 30s timeout)...')
|
||||
const alchemyConnection = driftService.getFallbackConnection()
|
||||
const connection = alchemyConnection || driftService.getConnection()
|
||||
|
||||
if (alchemyConnection) {
|
||||
console.log('✅ Using Alchemy RPC for transaction confirmation')
|
||||
} else {
|
||||
console.log('⚠️ No fallback RPC available, using primary RPC')
|
||||
}
|
||||
// BUT: Use timeout to prevent API hangs during network congestion
|
||||
console.log('⏳ Confirming transaction on-chain (30s timeout)...')
|
||||
const connection = driftService.getConnection()
|
||||
|
||||
try {
|
||||
const confirmationPromise = connection.confirmTransaction(txSig, 'confirmed')
|
||||
|
||||
Reference in New Issue
Block a user