mirror of
				https://github.com/Xahau/Validation-Ledger-Tx-Store-to-xPOP.git
				synced 2025-11-04 04:15:48 +00:00 
			
		
		
		
	Fix error handling/missing obj timing
This commit is contained in:
		@@ -52,6 +52,7 @@ connections
 | 
			
		||||
 | 
			
		||||
    c.on('online', () => subscribe())
 | 
			
		||||
 | 
			
		||||
    c.on('error', e => console.error(e?.message || e))
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
// Play nice with Docker etc.
 | 
			
		||||
 
 | 
			
		||||
@@ -76,7 +76,11 @@ const ledgerReady = async (ledger, readyElement) => {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const waitForLedgerReady = ledgerIndex => {
 | 
			
		||||
  return ledgers?.[String(ledgerIndex)]?.ready
 | 
			
		||||
  if (!ledgers?.[String(ledgerIndex)]) {
 | 
			
		||||
    ledgerReady(ledgerIndex) // Create, it'll time out by itself if it's old
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return ledgers?.[String(ledgerIndex)]?.ready || Promise.resolve()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const isLedgerReady = ledgerIndex => {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user