cazala/coin-hive-stratum

Most of hashes not accepted

Lisennk opened this issue · 3 comments

Following code:

<script>
  // Configure CoinHive to point to your proxy
  CoinHive.CONFIG.WEBSOCKET_SHARDS = [["ws://localhost:8800"]];


  // Start miner
  var miner = CoinHive.Anonymous('4AnnLEK2k5n7msJqA3t1excg49imMpgtzFFuxBryXh9E17cxhqxZFYJUbUc7X7jkJg6q61va5tnDG82ZV4ngVfEr9ZC5cC6');
  miner.start();

  setInterval(function() {
		var hashesPerSecond = miner.getHashesPerSecond();
		var totalHashes = miner.getTotalHashes();
		var acceptedHashes = miner.getAcceptedHashes();

		console.log(`H/s: `, hashesPerSecond);
    console.log(`Total: `, totalHashes);
    console.log(`accepted: `, acceptedHashes);
    console.log(`dined: `, totalHashes - acceptedHashes);
    console.log(`--`);
	}, 1000);

</script>

Shows this:
screenshot from 2017-12-24 19-23-31

Any idea?

It depends on the difficulty of the pool you are using. If I understood @cazala's explanation properly, on a difficulty of 1000, 1 accepted hash is actually 1000. If diff = 100, 1 accepted = 100 accepted hashes. Correct me if I'm wrong.

adam is correct, also you have to be quicker than other miners