Skip to content

Commit

Permalink
Use share value from server
Browse files Browse the repository at this point in the history
  • Loading branch information
jh000 committed Aug 1, 2013
1 parent b08be01 commit 3c93c1e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/primecoinMiner/prime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1028,16 +1028,13 @@ bool MineProbablePrimeChain(CSieveOfEratosthenes** psieve, primecoinBlock_t* blo
char sNow [80];
strftime (sNow, 80, "%x - %X",timeinfo);

float shareValue = pow(8, floor((float)((double)nProbableChainLength / (double)0x1000000)) - 7);

printf("%s - SHARE FOUND !!! (Th#: %u) --- DIFF: %f - VAL: %f %s %s\n",
sNow, threadIndex, (float)((double)nProbableChainLength / (double)0x1000000), shareValue,
printf("%s - SHARE FOUND !!! (Th#: %u) --- DIFF: %f %s %s\n",
sNow, threadIndex, (float)((double)nProbableChainLength / (double)0x1000000),
nProbableChainLength >= 0x6000000 ? ">6":"", nProbableChainLength >= 0x7000000 ? ">7":"");

// submit this share
if (jhMiner_pushShare_primecoin(blockRawData, block))
primeStats.foundShareCount ++;
primeStats.fShareValue += shareValue;
//printf("Probable prime chain found for block=%s!!\n Target: %s\n Length: (%s %s %s)\n", block.GetHash().GetHex().c_str(),TargetToString(block.nBits).c_str(), TargetToString(nChainLengthCunningham1).c_str(), TargetToString(nChainLengthCunningham2).c_str(), TargetToString(nChainLengthBiTwin).c_str());
//nProbableChainLength = max(max(nChainLengthCunningham1, nChainLengthCunningham2), nChainLengthBiTwin);
// since we are using C structs here we have to make sure the memory for the CBigNum in the block is freed again
Expand Down
1 change: 1 addition & 0 deletions src/primecoinMiner/primecoinMiner.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories=".\includes\"
Expand Down
3 changes: 2 additions & 1 deletion src/primecoinMiner/xptClientPacketHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ bool xptClient_processPacket_shareAck(xptClient_t* xptClient)
valid_shares++;
time_t now = time(0);
char* dt = ctime(&now);
printf("Valid share found!");
printf("Share accepted by server");
printf(" [ %d / %d val: %.6f] %s", valid_shares, total_shares, shareValue, dt);
primeStats.fShareValue += shareValue;
}
else
{
Expand Down

0 comments on commit 3c93c1e

Please sign in to comment.