@@ -492,6 +492,7 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer
492492 difficulty : this . difficulty ,
493493 diffHex : this . diffHex ,
494494 submissions : [ ] ,
495+ seed_hash : activeBlockTemplate . seedHash ? activeBlockTemplate . seedHash . toString ( 'hex' ) : null ,
495496 blockHash : activeBlockTemplate . idHash
496497 } ;
497498
@@ -501,6 +502,7 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer
501502 job_id : newJob . id ,
502503 target : target ,
503504 id : this . id ,
505+ seed_hash : activeBlockTemplate . seedHash ? activeBlockTemplate . seedHash . toString ( 'hex' ) : null ,
504506 height : newJob . height
505507 } ;
506508 } else {
@@ -519,6 +521,7 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer
519521 diffHex : this . diffHex ,
520522 clientPoolLocation : activeBlockTemplate . clientPoolLocation ,
521523 clientNonceLocation : activeBlockTemplate . clientNonceLocation ,
524+ seed_hash : activeBlockTemplate . seedHash ? activeBlockTemplate . seedHash . toString ( 'hex' ) : null ,
522525 submissions : [ ]
523526 } ;
524527 this . validJobs . enq ( newJob ) ;
@@ -531,6 +534,7 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer
531534 client_pool_offset : activeBlockTemplate . clientPoolLocation ,
532535 target_diff : this . difficulty ,
533536 target_diff_hex : this . diffHex ,
537+ seed_hash : activeBlockTemplate . seedHash ? activeBlockTemplate . seedHash . toString ( 'hex' ) : null ,
534538 job_id : newJob . id ,
535539 id : this . id
536540 } ;
@@ -622,8 +626,13 @@ function processShare(miner, job, blockTemplate, params, sendReply) {
622626 }
623627 else {
624628 convertedBlob = global . coinFuncs . convertBlob ( shareBuffer ) ;
625- hash = multiHashing . cryptonight ( convertedBlob , convertedBlob [ 0 ] >= 10 ? 13 : 8 , job . height ) ;
626- shareType = false ;
629+ if ( blockTemplate . seedHash && blockTemplate . seedHash . length == 32 ) {
630+ hash = multiHashing . randomx ( convertedBlob , blockTemplate . seedHash , 0 ) ;
631+ shareType = false ;
632+ } else {
633+ hash = multiHashing . cryptonight ( convertedBlob , convertedBlob [ 0 ] >= 10 ? 13 : 8 , job . height ) ;
634+ shareType = false ;
635+ }
627636 }
628637 if ( hash . toString ( 'hex' ) !== resultHash ) {
629638 if ( job . height >= 1546000 && coinFuncs . isxmr ) {
0 commit comments