more logs, reduce request chunk sizes
This commit is contained in:
		
							parent
							
								
									a2f6ea7b3a
								
							
						
					
					
						commit
						5998b54fec
					
				@ -181,7 +181,8 @@ class FailoverRouter {
 | 
				
			|||||||
      .catch((e) => {
 | 
					      .catch((e) => {
 | 
				
			||||||
        let fallbackHost = this.fallbackHost;
 | 
					        let fallbackHost = this.fallbackHost;
 | 
				
			||||||
        if (e?.response?.status !== 404) {
 | 
					        if (e?.response?.status !== 404) {
 | 
				
			||||||
          logger.warn(`esplora request failed ${e?.response?.status || 500} ${host.host}${path}`);
 | 
					          logger.warn(`esplora request failed ${e?.response?.status} ${host.host}${path}`);
 | 
				
			||||||
 | 
					          logger.warn(e instanceof Error ? e.message : e);
 | 
				
			||||||
          fallbackHost = this.addFailure(host);
 | 
					          fallbackHost = this.addFailure(host);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (retry && e?.code === 'ECONNREFUSED' && this.multihost) {
 | 
					        if (retry && e?.code === 'ECONNREFUSED' && this.multihost) {
 | 
				
			||||||
 | 
				
			|||||||
@ -480,14 +480,16 @@ class RbfCache {
 | 
				
			|||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (config.MEMPOOL.BACKEND === 'esplora') {
 | 
					    if (config.MEMPOOL.BACKEND === 'esplora') {
 | 
				
			||||||
      const sliceLength = 10000;
 | 
					      const sliceLength = 1000;
 | 
				
			||||||
      for (let i = 0; i < Math.ceil(txids.length / sliceLength); i++) {
 | 
					      for (let i = 0; i < Math.ceil(txids.length / sliceLength); i++) {
 | 
				
			||||||
        const slice = txids.slice(i * sliceLength, (i + 1) * sliceLength);
 | 
					        const slice = txids.slice(i * sliceLength, (i + 1) * sliceLength);
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
          const txs = await bitcoinApi.$getRawTransactions(slice);
 | 
					          const txs = await bitcoinApi.$getRawTransactions(slice);
 | 
				
			||||||
 | 
					          logger.debug(`fetched ${slice.length} cached rbf transactions`);
 | 
				
			||||||
          processTxs(txs);
 | 
					          processTxs(txs);
 | 
				
			||||||
 | 
					          logger.debug(`processed ${slice.length} cached rbf transactions`);
 | 
				
			||||||
        } catch (err) {
 | 
					        } catch (err) {
 | 
				
			||||||
          logger.err('failed to fetch some cached rbf transactions');
 | 
					          logger.err(`failed to fetch or process ${slice.length} cached rbf transactions`);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user