diff --git a/src/app/hooks/use-confirmation-checker.ts b/src/app/hooks/use-confirmation-checker.ts index 095d7e07..8b23a5df 100644 --- a/src/app/hooks/use-confirmation-checker.ts +++ b/src/app/hooks/use-confirmation-checker.ts @@ -1,4 +1,4 @@ -import { useContext, useRef } from 'react'; +import { useContext } from 'react'; import { Vault } from '@models/vault'; import { VaultContext } from '@providers/vault-context-provider'; @@ -10,7 +10,6 @@ export function useConfirmationChecker(): [string, number][] { const blockHeight = useBlockchainHeightQuery(); const { pendingVaults } = useContext(VaultContext); - const bitcoinTransactionBlockHeightMap = useRef(new Map()); async function fetchBitcoinTransactionBlockHeight(vault: Vault): Promise { try { @@ -23,11 +22,6 @@ export function useConfirmationChecker(): [string, number][] { if (!bitcoinTransactionBlockHeight) throw new Error('Could not fetch Bitcoin Transaction Block Height'); - bitcoinTransactionBlockHeightMap.current.set( - vault.withdrawDepositTX, - bitcoinTransactionBlockHeight - ); - return bitcoinTransactionBlockHeight; } catch (error) { throw new Error('Error fetching Bitcoin Transaction Block Height'); @@ -40,8 +34,7 @@ export function useConfirmationChecker(): [string, number][] { ): Promise { try { const bitcoinTransactionBlockHeight = - bitcoinTransactionBlockHeightMap.current.get(vault.withdrawDepositTX) ?? - (await fetchBitcoinTransactionBlockHeight(vault)); + await fetchBitcoinTransactionBlockHeight(vault); return blockHeight - bitcoinTransactionBlockHeight; } catch (error) {