Post
Topic
Board Mining software (miners)
Re: Embedable Javascript Bitcoin miner for your website
by
sparomba
on 04/06/2011, 09:48:27 UTC
i've had a closer look into the source of your JS Miner and I think there might be a multithreading problem or i misunderstood something. :-/

scenario: i'm running 3 websites, each of them is linked to the other, on each of them a JSMiner is present, all JSMiners are linked to the same bitp.it account.
What if a user has all 3 sites open at once or opens a single site in multiple windows? Wouldn't the multiple instances of the Miner compete against each other?

After the Miner-Client crunched through a task and didn't find a solution, it will ask for more work by making a GET call to
Quote
http://api.bitp.it/work?client_id=<>&domain=<>&hash_rate=<>&hash_count=<>
however there is no task-ID or whatsoever that identifies the last task that the client was working on. So i assume you use the client's IP or the "_node" Cookie to lable the last task in the server queue as "nothing found in that snippet"?
this is a problem when it comes to multiple open tabs, because the multiple JSMiner threads would compete with each other and clear each other from the task queue. If you identify the last task by the IP each call from that IP would simply clear the last task on the server, even if it is not the same as the task the client was working on. Same problem for the "_node" Cookie which is delivered/changed with each request, every instance would use the very same Cookie and by doing that mix up the task identification.

A solution would be a task-id variable in the GET request to the server, so you can identify the last task crunched by the client even if the user runs multiple JS Miners(for the same client_id) at the same time.