Add a comment about rateRec and its friend
This commit is contained in:
parent
b4199a3e1f
commit
0666762051
1 changed files with 2 additions and 0 deletions
|
|
@ -26,6 +26,8 @@ var poll = function(req, res) {
|
|||
var rateRec = _trader.rate(req.params.currency);
|
||||
var satoshiBalanceRec = _trader.balance;
|
||||
|
||||
// `rateRec` and `satoshiBalanceRec` are both objects, so there's no danger
|
||||
// of misinterpreting rate or balance === 0 as 'Server initializing'.
|
||||
if (!rateRec || !satoshiBalanceRec)
|
||||
return res.json({err: 'Server initializing'});
|
||||
if (Date.now() - rateRec.timestamp > STALE_TICKER)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue