Skip to content

Commit b3d48b7

Browse files
authored
Merge pull request #5 from zcoinofficial/dev
Change parameter in Lyra2 from fixed R to base on height
2 parents 96038b7 + f092181 commit b3d48b7

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/main.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2282,7 +2282,6 @@ unsigned int static BorisRidiculouslyNamedDifficultyFunction(const CBlockIndex*
22822282

22832283
unsigned int static GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock)
22842284
{
2285-
22862285
if(pindexLast == NULL)
22872286
{
22882287
return bnProofOfWorkLimit.GetCompact();
@@ -6257,13 +6256,13 @@ void static ScryptMiner(CWallet *pwallet)
62576256
loop
62586257
{
62596258
if( !fTestNet && pindexPrev->nHeight + 1 >= 500){
6260-
LYRA2(BEGIN(thash), 32, BEGIN(pblock->nVersion), 80, BEGIN(pblock->nVersion), 80, 2, 32768, 256);
6261-
printf("thash: %s\n", thash.ToString().c_str());
6262-
printf("hashTarget: %s\n", hashTarget.ToString().c_str());
6259+
LYRA2(BEGIN(thash), 32, BEGIN(pblock->nVersion), 80, BEGIN(pblock->nVersion), 80, 2, pindexPrev->nHeight + 1, 256);
6260+
//printf("thash: %s\n", thash.ToString().c_str());
6261+
//printf("hashTarget: %s\n", hashTarget.ToString().c_str());
62636262
}else if(fTestNet && pindexPrev->nHeight + 1 >= 138){
6264-
LYRA2(BEGIN(thash), 32, BEGIN(pblock->nVersion), 80, BEGIN(pblock->nVersion), 80, 2, 32768, 256);
6265-
printf("thash: %s\n", thash.ToString().c_str());
6266-
printf("hashTarget: %s\n", hashTarget.ToString().c_str());
6263+
LYRA2(BEGIN(thash), 32, BEGIN(pblock->nVersion), 80, BEGIN(pblock->nVersion), 80, 2, pindexPrev->nHeight + 1, 256);
6264+
//printf("thash: %s\n", thash.ToString().c_str());
6265+
//printf("hashTarget: %s\n", hashTarget.ToString().c_str());
62676266
}else{
62686267
scrypt_N_1_1_256_sp_generic(BEGIN(pblock->nVersion), BEGIN(thash), scratchpad, GetNfactor(pblock->nTime));
62696268
}

src/main.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,9 +1358,9 @@ class CBlockHeader
13581358
uint256 thash;
13591359

13601360
if( !fTestNet && height >= 500){
1361-
LYRA2(BEGIN(thash), 32, BEGIN(nVersion), 80, BEGIN(nVersion), 80, 2, 32768, 256);
1361+
LYRA2(BEGIN(thash), 32, BEGIN(nVersion), 80, BEGIN(nVersion), 80, 2, height, 256);
13621362
}else if(fTestNet && height >= 138){
1363-
LYRA2(BEGIN(thash), 32, BEGIN(nVersion), 80, BEGIN(nVersion), 80, 2, 32768, 256);
1363+
LYRA2(BEGIN(thash), 32, BEGIN(nVersion), 80, BEGIN(nVersion), 80, 2, height, 256);
13641364
}else{
13651365
scrypt_N_1_1_256(BEGIN(nVersion), BEGIN(thash), GetNfactor(nTime));
13661366
}

0 commit comments

Comments
 (0)