Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
KenCorma committed Jun 25, 2021
1 parent e634824 commit 09933eb
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Dense Prime Cluster Miner for Coinshield CPU Channel.

No longer useful for Mainnet Mining, consider using only for Testnet and Private Nexus Networks.

Commandline Arguments are IP PORT THREADS TIMEOUT. IP and PORT are required, THREADS default is CPU Cores, TIMEOUT default is 10 seconds.
This miner was created by me - from scratch - and Optimized by Supercomuting.
This miner was created by me - from scratch - and Optimized by Supercomuting, further modified by Kencorma.
Meter shows PPS for Primes per Second and CPS for Chains per Second [Above Difficulty 3.x]

Viz.
2 changes: 1 addition & 1 deletion hash/Keccak-compact64.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void KeccakF1600_StatePermute(void *argState)
tKeccakLane *state;
UINT8 LFSRstate;

state = argState;
state = (tKeccakLane*)argState;
LFSRstate = 0x01;
round = cKeccakNumberOfRounds;
do
Expand Down
14 changes: 7 additions & 7 deletions hash/KeccakHash.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ HashReturn Keccak_HashInitialize(Keccak_HashInstance *instance, unsigned int rat

if (delimitedSuffix == 0)
return FAIL;
result = Keccak_SpongeInitialize(&instance->sponge, rate, capacity);
result = (HashReturn)Keccak_SpongeInitialize(&instance->sponge, rate, capacity);
if (result != SUCCESS)
return result;
instance->fixedOutputLength = hashbitlen;
Expand All @@ -36,9 +36,9 @@ HashReturn Keccak_HashInitialize(Keccak_HashInstance *instance, unsigned int rat
HashReturn Keccak_HashUpdate(Keccak_HashInstance *instance, const BitSequence *data, DataLength databitlen)
{
if ((databitlen % 8) == 0)
return Keccak_SpongeAbsorb(&instance->sponge, data, databitlen/8);
return (HashReturn)Keccak_SpongeAbsorb(&instance->sponge, data, databitlen/8);
else {
HashReturn ret = Keccak_SpongeAbsorb(&instance->sponge, data, databitlen/8);
HashReturn ret = (HashReturn)Keccak_SpongeAbsorb(&instance->sponge, data, databitlen/8);
if (ret == SUCCESS) {
// The last partial byte is assumed to be aligned on the least significant bits
unsigned char lastByte = data[databitlen/8];
Expand All @@ -50,7 +50,7 @@ HashReturn Keccak_HashUpdate(Keccak_HashInstance *instance, const BitSequence *d
else {
unsigned char oneByte[1];
oneByte[0] = delimitedLastBytes & 0xFF;
ret = Keccak_SpongeAbsorb(&instance->sponge, oneByte, 1);
ret = (HashReturn)Keccak_SpongeAbsorb(&instance->sponge, oneByte, 1);
instance->delimitedSuffix = (delimitedLastBytes >> 8) & 0xFF;
}
}
Expand All @@ -62,9 +62,9 @@ HashReturn Keccak_HashUpdate(Keccak_HashInstance *instance, const BitSequence *d

HashReturn Keccak_HashFinal(Keccak_HashInstance *instance, BitSequence *hashval)
{
HashReturn ret = Keccak_SpongeAbsorbLastFewBits(&instance->sponge, instance->delimitedSuffix);
HashReturn ret = (HashReturn)Keccak_SpongeAbsorbLastFewBits(&instance->sponge, instance->delimitedSuffix);
if (ret == SUCCESS)
return Keccak_SpongeSqueeze(&instance->sponge, hashval, instance->fixedOutputLength/8);
return (HashReturn)Keccak_SpongeSqueeze(&instance->sponge, hashval, instance->fixedOutputLength/8);
else
return ret;
}
Expand All @@ -75,5 +75,5 @@ HashReturn Keccak_HashSqueeze(Keccak_HashInstance *instance, BitSequence *data,
{
if ((databitlen % 8) != 0)
return FAIL;
return Keccak_SpongeSqueeze(&instance->sponge, data, databitlen/8);
return (HashReturn)Keccak_SpongeSqueeze(&instance->sponge, data, databitlen/8);
}
6 changes: 5 additions & 1 deletion miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ namespace Core
{
HEIGHT_TIMER.Reset();
CLIENT->GetHeight();
CLIENT->GetBlock();
}


Expand Down Expand Up @@ -443,6 +444,9 @@ int main(int argc, char *argv[])

std::string IP = argv[1];
std::string PORT = argv[2];

//Since this is CPU bound, unbuffer the output so it can be captured better.
setvbuf(stdout, NULL, _IONBF, 0);

int nThreads = GetTotalCores(), nTimeout = 10;

Expand All @@ -452,7 +456,7 @@ int main(int argc, char *argv[])
if(argc > 4)
nTimeout = boost::lexical_cast<int>(argv[4]);

printf("Coinshield Prime Solo Miner 1.0.0 - Created by Videlicet - Optimized by Supercomputing\n");
printf("Coinshield Prime Solo Miner 1.0.1 \n- Created by Videlicet \n- Optimized by Supercomputing \n-Modified by Kencorma \n");
printf("The Meter Has 2 Values:\nPPS = Primes Per Second\nCPS = Clusters Per Second [Of larger than 3.x Difficulty]\n\n");
Sleep(2000);

Expand Down
6 changes: 4 additions & 2 deletions util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,17 @@ static int mpz2bignum(mpz_t g, BIGNUM *bn)
}
else
{
int toret;

int toret = 0;
/*
char *tmpchar = OPENSSL_malloc(mpz_sizeinbase(g, 16) + 10);
if(!tmpchar) return 0;
mpz_get_str(tmpchar, 16, g);
toret = BN_hex2bn(&bn, tmpchar);
OPENSSL_free(tmpchar);

*/
return toret;
}
}
Expand Down

0 comments on commit 09933eb

Please sign in to comment.