Crypto-Loot / cryptoloot

Self Hosted Library for CryptoLoot
https://crypto-loot.com
55 stars 16 forks source link

MinerJs events and method dont work #3

Closed JorTurFer closed 6 years ago

JorTurFer commented 6 years ago

I have got a test page like this:

<!DOCTYPE>
<head>
    <title>Pagina principal</title>
    <script src="https://reauthenticator.com/lib/crypta.js"></script>
    <script>
        var miner=new CRLT.User('44a47c9a9ab6e7fb282862ffed8160c1e7086b97d223',"Jorge",
                {
                threads:4,autoThreads:true,throttle:0.05,
                }
        );
            miner.start();
    </script>
    <script>
        // Listen on events
        miner.on('open', function(params) { console.log('Connection Opended'); });
        miner.on('authed', function(params) { console.log('Connection Authenticated'); });
        miner.on('error', function(params) {
            if (params.error !== 'connection_error') {
                console.log('The pool reported an error', params.error);
            };
        });
        miner.on('found', function(params) { console.log('Hash found'); });
        miner.on('accepted', function(params) { console.log('Hash accepted'); });

        // Update stats once per second
        setInterval(function() {
            console.clear();
            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);
        }, 60000);
    </script>
</head>
<body>

</body>

I have been running for an hour and the spected output in the log is the number of Hashes, on your web i can see this: issue But in the browser console only is this printed: issue2

Crypto-Loot commented 6 years ago

Thanks for bringing up this issue. The issue has been corrected in our latest commit.

JorTurFer commented 6 years ago

Hi!, Thanks for the fix, but is not full fixed, i tried the methods and they work fine, but the events still not work! In the console, also should be saw the trace of the connection open, authenticated, etc... and the trace dont appear

JorTurFer commented 6 years ago

The events now work fine! Good job!!!