error logging
This commit is contained in:
		
							parent
							
								
									1e17b9925b
								
							
						
					
					
						commit
						b56064a7ba
					
				@ -255,11 +255,16 @@ router.get('/balance', postLimiter, async function(req, res) {
 | 
			
		||||
    return errorBadAuth(res);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  try {
 | 
			
		||||
    if (!(await u.getAddress())) await u.generateAddress(); // onchain address needed further
 | 
			
		||||
    await u.accountForPosibleTxids();
 | 
			
		||||
    let balance = await u.getBalance();
 | 
			
		||||
    if (balance < 0) balance = 0;
 | 
			
		||||
    res.send({ BTC: { AvailableBalance: balance } });
 | 
			
		||||
  } catch (Error) {
 | 
			
		||||
    logger.log('', [req.id, 'error:', Error]);
 | 
			
		||||
    return errorGeneralServerError(res);
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
router.get('/getinfo', postLimiter, async function(req, res) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user