z-classic / z-nomp

z-nomp is mining pool software for Zcash and Zclassic so you can create internet money in your home!
MIT License
288 stars 441 forks source link

No balance displayed #233

Closed przpl closed 6 years ago

przpl commented 6 years ago

There is a bug with miner's balance. Although miner has some balance according to redis data, there is 0 in api request (worker_stats?addr). It happens to random miners. What is wrong?

przpl commented 6 years ago

The problem resides in stats.js (z-nomp/libs/stats.js). For some reasons for some addresses the hscan function returns empty array, altough the correct records exsits in redis db (checked with redis-commander). For example I have in zcash:balances the t123 address with value equal to 25, but the scan function returns nothing. It looks like match doesn't work in some cases. But why?

racquemis commented 6 years ago

It has to do with the 10000 in that listed in query. It limits thr query to 10000 records. If you have a large pool with many addresses mining on it or in the past you could have entries at index 10001 for example. Those entries won't be fetched. Try increasing that value. It fixed the issue for me. You can possibility even omit the limit all together