team-exor / eiquidus

Feature-rich open-source altcoin block explorer. Regular Updates ~ Platform Independent ~ Mobile Friendly ~ Supports Themes, Markets, Charts, Claiming Addresses, Public API's, Custom RPC Cmds, Bitcoin, Heavycoin, zk-SNARKs ~ List Masternodes, Network Peers, Top 100 Wallets ~ Built-in Update Script ~ Highly Customizable
https://explorer.exor.io
BSD 3-Clause "New" or "Revised" License
87 stars 180 forks source link

Explorer shows a line for POS difficulty when it's a POW coin #33

Closed sudormdir closed 1 year ago

sudormdir commented 1 year ago

I have the settings.json set to difficulty="POW" yet it still shows a difficulty for POS in the chart. I even tried using npm run reindex but it didn't fix the problem. I looked at the MongoDB and saw that in db.networkhistories a value is set for difficulty_pos for every object. The first value is equal to what the difficulty_pow should be, probably because I didn't change the difficulty until after I already ran the program a few times, but it's 0 for every subsequent object and the difficulty_pow displays the real difficulty. How can I make sure the chart doesn't show the POS difficulty? Running on Ubuntu 22.04.3 LTS

sudormdir commented 1 year ago

I got inpatient and ran npm run delete-database and then npm run sync-blocks. That did the trick. Was happy to find that delete-database didn't really delete the database, it just erased its contents.

joeuhren commented 1 year ago

Sorry for the late reply and thanks for the details about how you resolved this issue. It is already on my list to update the reindex process so that it essentially calls the delete-database script which is more complete and much faster than the current reindex.

You are also correct that the issue occurred because you changed the difficulty value after syncing the initial data. For anyone else reading that has a similar issue and doesn't want to reindex the explorer, you can always just wait a couple hours while syncing and the old data will eventually get pushed out of the network history chart(s) automatically since it only saves the top 120 blocks by default.