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);
 | 
					    return errorBadAuth(res);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (!(await u.getAddress())) await u.generateAddress(); // onchain address needed further
 | 
					  try {
 | 
				
			||||||
  await u.accountForPosibleTxids();
 | 
					    if (!(await u.getAddress())) await u.generateAddress(); // onchain address needed further
 | 
				
			||||||
  let balance = await u.getBalance();
 | 
					    await u.accountForPosibleTxids();
 | 
				
			||||||
  if (balance < 0) balance = 0;
 | 
					    let balance = await u.getBalance();
 | 
				
			||||||
  res.send({ BTC: { AvailableBalance: balance } });
 | 
					    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) {
 | 
					router.get('/getinfo', postLimiter, async function(req, res) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user