Skip to content

Commit

Permalink
Merge pull request #5 from zcoinofficial/dev
Browse files Browse the repository at this point in the history
Change parameter in Lyra2 from fixed R to base on height
  • Loading branch information
nopslide authored Sep 29, 2016
2 parents 96038b7 + f092181 commit b3d48b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 6 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2282,7 +2282,6 @@ unsigned int static BorisRidiculouslyNamedDifficultyFunction(const CBlockIndex*

unsigned int static GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock)
{

if(pindexLast == NULL)
{
return bnProofOfWorkLimit.GetCompact();
Expand Down Expand Up @@ -6257,13 +6256,13 @@ void static ScryptMiner(CWallet *pwallet)
loop
{
if( !fTestNet && pindexPrev->nHeight + 1 >= 500){
LYRA2(BEGIN(thash), 32, BEGIN(pblock->nVersion), 80, BEGIN(pblock->nVersion), 80, 2, 32768, 256);
printf("thash: %s\n", thash.ToString().c_str());
printf("hashTarget: %s\n", hashTarget.ToString().c_str());
LYRA2(BEGIN(thash), 32, BEGIN(pblock->nVersion), 80, BEGIN(pblock->nVersion), 80, 2, pindexPrev->nHeight + 1, 256);
//printf("thash: %s\n", thash.ToString().c_str());
//printf("hashTarget: %s\n", hashTarget.ToString().c_str());
}else if(fTestNet && pindexPrev->nHeight + 1 >= 138){
LYRA2(BEGIN(thash), 32, BEGIN(pblock->nVersion), 80, BEGIN(pblock->nVersion), 80, 2, 32768, 256);
printf("thash: %s\n", thash.ToString().c_str());
printf("hashTarget: %s\n", hashTarget.ToString().c_str());
LYRA2(BEGIN(thash), 32, BEGIN(pblock->nVersion), 80, BEGIN(pblock->nVersion), 80, 2, pindexPrev->nHeight + 1, 256);
//printf("thash: %s\n", thash.ToString().c_str());
//printf("hashTarget: %s\n", hashTarget.ToString().c_str());
}else{
scrypt_N_1_1_256_sp_generic(BEGIN(pblock->nVersion), BEGIN(thash), scratchpad, GetNfactor(pblock->nTime));
}
Expand Down
4 changes: 2 additions & 2 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -1358,9 +1358,9 @@ class CBlockHeader
uint256 thash;

if( !fTestNet && height >= 500){
LYRA2(BEGIN(thash), 32, BEGIN(nVersion), 80, BEGIN(nVersion), 80, 2, 32768, 256);
LYRA2(BEGIN(thash), 32, BEGIN(nVersion), 80, BEGIN(nVersion), 80, 2, height, 256);
}else if(fTestNet && height >= 138){
LYRA2(BEGIN(thash), 32, BEGIN(nVersion), 80, BEGIN(nVersion), 80, 2, 32768, 256);
LYRA2(BEGIN(thash), 32, BEGIN(nVersion), 80, BEGIN(nVersion), 80, 2, height, 256);
}else{
scrypt_N_1_1_256(BEGIN(nVersion), BEGIN(thash), GetNfactor(nTime));
}
Expand Down

0 comments on commit b3d48b7

Please sign in to comment.