add comment

This commit is contained in:
Ivan Socolsky 2016-05-24 11:25:54 -03:00
parent 3d7a12f3ab
commit b7bc041f79
No known key found for this signature in database
GPG Key ID: FAECE6A05FAA4F56
1 changed files with 6 additions and 2 deletions

View File

@ -942,9 +942,13 @@ WalletService.prototype._getUtxosForCurrentWallet = function(addresses, cb) {
});
},
function(next) {
var fromTs = Math.floor(Date.now() / 1000) - 24 * 3600;
var now = Math.floor(Date.now() / 1000);
// Fetch latest broadcasted txs and remove any spent inputs from the
// list of UTXOs returned by the block explorer. This counteracts any out-of-sync
// effects between broadcasting a tx and getting the list of UTXOs.
// This is especially true in the case of having multiple instances of the block explorer.
self.storage.fetchBroadcastedTxs(self.walletId, {
minTs: fromTs,
minTs: now - 24 * 3600,
limit: 100
}, function(err, txs) {
if (err) return next(err);