store address index even when no new addresses are generated

This commit is contained in:
Ivan Socolsky 2017-04-13 11:57:40 -03:00
parent 2d3df0a12e
commit 4fd339da29
No known key found for this signature in database
GPG Key ID: FAECE6A05FAA4F56
1 changed files with 3 additions and 1 deletions

View File

@ -481,7 +481,9 @@ Storage.prototype.storeAddressAndWallet = function(wallet, addresses, cb) {
return next(false);
});
}, function(newAddresses) {
if (newAddresses.length == 0) return cb();
if (newAddresses.length < addresses.length) {
log.warn('Attempted to store already existing addresses on wallet ' + wallet.id);
}
self.db.collection(collections.ADDRESSES).insert(newAddresses, {
w: 1
}, function(err) {