Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This..... dosent work. #169

Open
ghost opened this issue Mar 9, 2019 · 6 comments
Open

This..... dosent work. #169

ghost opened this issue Mar 9, 2019 · 6 comments

Comments

@ghost
Copy link

ghost commented Mar 9, 2019

        _this.stratumServer = new stratum.Server(options, authorizeFn);

        _this.stratumServer.on('started', function(){
            options.initStats.stratumPorts = Object.keys(options.ports);
            _this.stratumServer.broadcastMiningJobs(_this.jobManager.currentJob.getJobParams());
            finishedCallback();

        }).on('broadcastTimeout', function(){
            emitLog('No new blocks for ' + options.jobRebroadcastTimeout + ' seconds - updating transactions & rebroadcasting work');

            **GetBlockTemplate(function(error, rpcData, processedBlock){
                if (error || processedBlock) return;
                _this.jobManager.updateCurrentJob(rpcData);**
            });```
@ghost
Copy link
Author

ghost commented Mar 9, 2019

jobRebroadcastTimeout does not update correctly the mining difficulty if the mining difficulty in THE SAME BLOCK changes with time.

@ghost
Copy link
Author

ghost commented Mar 9, 2019

so if the mining difficulty is adjusted with time, like in some adjusted darkgravitywave algorithm that scale difficulty down with TIME ( for example, progressively lower difficulty if there is a long stale tip..... ) ..... the pool dosent brodcast that info, and the miners keeps trying to mine a higher difficulty block, and if a block is found, the difficulty bits dosent match the pow difficulty bits.

@ghost
Copy link
Author

ghost commented Mar 9, 2019

When a new block is found, the pool sends a new getblocktemplate and checks the new difficulty for the next block. jobrebrodcast timeout should also do this.

Or a new option could be added for coins that changes difficulty in the same block over time.

@ghost
Copy link
Author

ghost commented Mar 9, 2019

.on('broadcastTimeout', function(){
emitLog('No new blocks for ' + options.jobRebroadcastTimeout + ' seconds - updating transactions & rebroadcasting work');

        GetBlockTemplate(function(error, rpcData, processedBlock){
	 emitLog('This is the value of rpcData : ', rpcdata);
	 emitLog('Its supposed to return if there is an error or a processedBlock ....  will it return ?');
            if (error || processedBlock) return;
	 emitLog('no, did not return...');
            _this.jobManager.updateCurrentJob(rpcData);
	emitLog('sent updateCurrentJob(rpcdata) to jobManager');
        });

@ghost
Copy link
Author

ghost commented Mar 9, 2019

RESULT :

2019-03-09 12:38:56 [Pool] [lightningcash gold] (Thread 8) No new blocks for 30 seconds - updating transactions & rebroadcasting work
/home/merlin/nomp/node_modules/stratum-pool/lib/pool.js:476
emitLog('This is the value of rpcData : ', rpcdata);
^

ReferenceError: rpcdata is not defined
at /home/merlin/nomp/node_modules/stratum-pool/lib/pool.js:476:46
at /home/merlin/nomp/node_modules/stratum-pool/lib/pool.js:592:21
at itemFinished (/home/merlin/nomp/node_modules/stratum-pool/lib/daemon.js:156:36)
at /home/merlin/nomp/node_modules/stratum-pool/lib/daemon.js:169:17
at parseJson (/home/merlin/nomp/node_modules/stratum-pool/lib/daemon.js:85:17)
at IncomingMessage. (/home/merlin/nomp/node_modules/stratum-pool/lib/daemon.js:95:17)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
2019-03-09 12:38:56 [Master] [PoolSpawner] Fork 7 died, spawning replacement worker...

@ghost
Copy link
Author

ghost commented Mar 9, 2019

Further debugging gives this :

2019-03-09 13:02:32 [Pool] [lightningcash gold] (Thread 5) No new blocks for 30 seconds - updating transactions & rebroadcasting work
2019-03-09 13:02:32 [Pool] [lightningcash gold] (Thread 5) Its supposed to return if there is an error or a processedBlock .... will it return ?
2019-03-09 13:02:32 [Pool] [lightningcash gold] (Thread 5) no, did not return... ( normal here.... )
2019-03-09 13:02:32 [Pool] [lightningcash gold] (Thread 5) This is the value of result : (empty ???)
2019-03-09 13:02:32 [Pool] [lightningcash gold] (Thread 5) sent updateCurrentJob(result) to jobManager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants