Skip to content

Commit

Permalink
Merge branch 'Verus2.2' of https://github.com/monkins1010/ccminer int…
Browse files Browse the repository at this point in the history
…o Verus2.2
  • Loading branch information
monkins1010 committed May 20, 2023
2 parents 7c739a0 + 374d327 commit 1d50a3c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions equi/equi-stratum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@ bool equi_stratum_submit(struct pool_infos *pool, struct work *work)
}
cbin2hex(solhex, (const char*) work->extra, 1347);

char* solHexRestore = (char*) calloc(128, 1);
cbin2hex(solHexRestore, (const char*)&work->solution[8], 64);
memcpy(&solhex[6+16], solHexRestore, 128);


jobid = work->job_id + 8;
sprintf(timehex, "%08x", swab32(work->data[25]));

Expand All @@ -262,6 +267,7 @@ bool equi_stratum_submit(struct pool_infos *pool, struct work *work)
pool->user, jobid, timehex, noncestr, solhex,
stratum.job.shares_count + 10);

free(solHexRestore);
free(solhex);
free(noncestr);

Expand Down
10 changes: 7 additions & 3 deletions verus/verusscan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,14 @@ extern "C" int scanhash_verus(int thr_id, struct work *work, uint32_t max_nonce,
memcpy(sol_data + 3, work->solution, 1344);
uint8_t version = work->solution[0];

if (version >= 7) {
if (version >= 7) {
// clear non-canonical data from header/solution before hashing; required for merged mining
memset(full_data + 4, 0, 96); // hashPrevBlock, hashMerkleRoot, hashFinalSaplingRoot
memset(full_data + 4 + 32 + 32 + 32 + 4, 0, 4); // nBits
memset(full_data + 4 + 32 + 32 + 32 + 4 + 4, 0, 32); // nNonce
memset(sol_data+3+ 8, 0, 64); // hashPrevMMRRoot, hashBlockMMRRoot
}


}
uint32_t vhash[8] = { 0 };

VerusHashHalf(blockhash_half, (unsigned char*)full_data, 1487);
Expand Down

0 comments on commit 1d50a3c

Please sign in to comment.