Algorithm weightings for work contribution to chain

This commit is contained in:
myriadcoin
2014-04-07 18:39:15 +02:00
parent 4bbebad4f3
commit 34abdc7317
4 changed files with 14 additions and 9 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 8
#define CLIENT_VERSION_REVISION 99
#define CLIENT_VERSION_BUILD 7
#define CLIENT_VERSION_BUILD 8
// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
+2 -1
View File
@@ -2089,10 +2089,11 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
nBestChainWork = pindexNew->nChainWork;
nTimeBestReceived = GetTime();
nTransactionsUpdated++;
printf("SetBestChain: new best=%s height=%d pow_algo=%d log2_work=%.8g tx=%lu date=%s progress=%f\n",
printf("SetBestChain: new best=%s height=%d pow_algo=%d block_work=%s log2_work=%.8g tx=%lu date=%s progress=%f\n",
hashBestChain.ToString().c_str(),
nBestHeight,
pindexNew->GetAlgo(),
pindexNew->GetBlockWorkAdjusted().ToString().c_str(),
log(nBestChainWork.getdouble())/log(2.0),
(unsigned long)pindexNew->nChainTx,
DateTimeStrFormat("%Y-%m-%d %H:%M:%S", pindexBest->GetBlockTime()).c_str(),
+11 -6
View File
@@ -687,7 +687,7 @@ enum BlockStatus {
BLOCK_FAILED_MASK = 96
};
const int64 nBlockAlgoWeightStart = 1000000;
const int64 nBlockAlgoWorkWeightStart = 142000; // block where algo work weighting starts
/** The block chain is a tree shaped structure starting with the
* genesis block at the root, with each block potentially having multiple
@@ -830,7 +830,11 @@ public:
int GetAlgoWorkFactor() const
{
if (nHeight < nBlockAlgoWeightStart)
if (!TestNet() && (nHeight < nBlockAlgoWorkWeightStart))
{
return 1;
}
if (TestNet() && (nHeight < 100))
{
return 1;
}
@@ -838,14 +842,15 @@ public:
{
case ALGO_SHA256D:
return 1;
// work factor = absolute work ratio * optimisation factor
case ALGO_SCRYPT:
return 1;
return 1024 * 4;
case ALGO_GROESTL:
return 1;
return 64 * 8;
case ALGO_SKEIN:
return 1;
return 4 * 6;
case ALGO_QUBIT:
return 1;
return 128 * 8;
default:
return 1;
}
-1
View File
@@ -201,4 +201,3 @@ Value getaddednodeinfo(const Array& params, bool fHelp)
return ret;
}