So, to test this out, I simply just deleted all the collections, ran "npm start" to recreate the collections for a new install, and then ran the node scripts/sync.js index reindex, or update. Either one should work fine, but it appears that because of the way we get the "end" we break.
https://github.com/uaktags/explorer/blob/8ed38ea51b23a9d466bf41d0c5705fbbf869392d/scripts/sync.js#L140-L141
This is where the problem seems to come into play.
db.update_db is suppose to set the stats.count to what the current blockcount is. Then right after all that is done, it's db.get_stats which pulls that information (a redundant call), but for whatever reason we still get left with a 0.
So, to test this out, I simply just deleted all the collections, ran "npm start" to recreate the collections for a new install, and then ran the node scripts/sync.js index reindex, or update. Either one should work fine, but it appears that because of the way we get the "end" we break. https://github.com/uaktags/explorer/blob/8ed38ea51b23a9d466bf41d0c5705fbbf869392d/scripts/sync.js#L140-L141 This is where the problem seems to come into play.
db.update_db
is suppose to set the stats.count to what the current blockcount is. Then right after all that is done, it's db.get_stats which pulls that information (a redundant call), but for whatever reason we still get left with a 0.