Pages:
Author

Topic: [ANN] [xpc]porkcoin X11PoW/PoS | market|Picture Match|Bittrex - page 13. (Read 34473 times)

full member
Activity: 207
Merit: 100
full member
Activity: 207
Merit: 100
@tuaris

Do you understand, I found that I need to be modified to come over.   this  is correct  that  result is  different each time.
by this way
Code:
   srand((unsigned)time(NULL));
    int xxx=rand()%160;
full member
Activity: 207
Merit: 100

github:https://github.com/porkcoin/porkcoin


The seed is based on the previous block hash
https://github.com/porkcoin/porkcoin/blob/master/src/main.cpp#L936
Code:
int64 GetProofOfWorkReward(int nHeight, int64 nFees, uint256 prevHash)
{
    int64 nSubsidy = 1 * COIN;

    srand((unsigned)time(NULL));
    int xxx=rand()%160;

    if(nHeight == 1)
    {
        nSubsidy = 100000 * COIN;
    }else
    if(nHeight < 10000)
    {
        if(nHeight % (160 + xxx) ==0) nSubsidy = 1024 * COIN;
            else
        nSubsidy = 1 * COIN;
    }else  if(nHeight > 10000 && nHeight < 20000 )
    {        
         if(nHeight % (160 + xxx) ==0) nSubsidy = 512 * COIN;
             else
         nSubsidy = 1 * COIN;
    }else  if(nHeight > 20000 && nHeight < 40000 )
    {
         if(nHeight % (160 + xxx) ==0) nSubsidy = 256 * COIN;
             else
         nSubsidy = 1 * COIN;
    }else   if(nHeight > 40000 && nHeight < 80000 )
    {
         if(nHeight % (160 + xxx) ==0) nSubsidy = 128 * COIN;
             else
         nSubsidy = 1 * COIN;
    }
    else   if(nHeight > 80000 && nHeight < 160000 )
    {
         if(nHeight % (160 + xxx) ==0) nSubsidy = 64 * COIN;
             else
         nSubsidy = 1 * COIN;
    }
    else   if(nHeight > 160000 && nHeight < 320000 )
    {
         if(nHeight % (160 + xxx) ==0) nSubsidy = 32 * COIN;
             else
         nSubsidy = 1 * COIN;
    }
    else   if(nHeight > 320000 && nHeight < 640000 )
    {
         if(nHeight % (160 + xxx) ==0) nSubsidy = 16 * COIN;
             else
         nSubsidy = 1 * COIN;
    }else     if(nHeight >  640000 )
    {
         if(nHeight % (160 + xxx) ==0) nSubsidy = 8 * COIN;
             else
         nSubsidy = 1 * COIN;
    }

    return nSubsidy + nFees;
}
full member
Activity: 207
Merit: 100
Code:
#include 

using namespace std;

int main() {
        srand((unsigned)time(NULL));
        int xxx=rand()%160;
        cout << xxx << endl;
        return 0;
}

$ ./a.out
155
$ ./a.out
2
$ ./a.out
9
$ ./a.out
16


  it  is   correct,He was able to meet the need, purpose is to don't know in which position the position of between 160 and 320.
The purpose of this code  adjustment is in selective miners mining


Code:
You should find someone more experienced to review and fix the code, then re-luanch this coin.

Won't go to  re-luanch this coin., because it is very important to a one-time luanch, in order to protect have been mined  the coin.
hero member
Activity: 780
Merit: 501
The source code on Github is incomplete

Code:
c++: warning: cannot open ../share/genbuild.sh: No such file or directory

Missing the 'share' folder.
I can't build the wallet or setup a mining pool until that is fixed.

had  commit  'share'  folder

https://github.com/porkcoin/porkcoin/tree/master/share

Thanks, how about the issue with the random number generator based on time mentioned above?  That is wrong.


fix  it

https://github.com/porkcoin/porkcoin/blob/master/src/main.cpp#L938
Code:
    srand((unsigned)time(NULL));
    int xxx=rand()%160;

It's incorrect to seed the random number generator with the current time.  The result will be different each time.

Example:

Code:
#include 

using namespace std;

int main() {
        srand((unsigned)time(NULL));
        int xxx=rand()%160;
        cout << xxx << endl;
        return 0;
}

Code:
$ ./a.out
155
$ ./a.out
2
$ ./a.out
9
$ ./a.out
16

Code:
#include 

using namespace std;

int main() {
        srand((unsigned)100);
        int xxx=rand()%160;
        cout << xxx << endl;
        return 0;
}

Code:
$ ./a.out
66
$ ./a.out
66
$ ./a.out
66
$ ./a.out
66

@elbandi, that's a good catch.  I can't believe I missed that.  Roll Eyes

Look at this correct example:
https://github.com/kittehcoin/kittehcoin/blob/master/src/main.cpp#L1072

The seed is based on the previous block hash
https://github.com/kittehcoin/kittehcoin/blob/master/src/main.cpp#L1090

You should find someone more experienced to review and fix the code, then re-luanch this coin.
full member
Activity: 207
Merit: 100
The source code on Github is incomplete

Code:
c++: warning: cannot open ../share/genbuild.sh: No such file or directory

Missing the 'share' folder.
I can't build the wallet or setup a mining pool until that is fixed.

had  commit  'share'  folder

https://github.com/porkcoin/porkcoin/tree/master/share

Thanks, how about the issue with the random number generator based on time mentioned above?  That is wrong.


fix  it

https://github.com/porkcoin/porkcoin/blob/master/src/main.cpp#L938
Code:
    srand((unsigned)time(NULL));
    int xxx=rand()%160;
hero member
Activity: 780
Merit: 501
The source code on Github is incomplete

Code:
c++: warning: cannot open ../share/genbuild.sh: No such file or directory

Missing the 'share' folder.
I can't build the wallet or setup a mining pool until that is fixed.

had  commit  'share'  folder

https://github.com/porkcoin/porkcoin/tree/master/share

Thanks, how about the issue with the random number generator based on time mentioned above?  That is wrong.
full member
Activity: 207
Merit: 100
The source code on Github is incomplete

Code:
c++: warning: cannot open ../share/genbuild.sh: No such file or directory

Missing the 'share' folder.
I can't build the wallet or setup a mining pool until that is fixed.

had  commit  'share'  folder

https://github.com/porkcoin/porkcoin/tree/master/share
hero member
Activity: 700
Merit: 500
We need a pool now!
erh , not for this coin mate that would be a waste of time and money and electricity ^_^
hero member
Activity: 525
Merit: 531
this commit is wrong, do not upgrade!!!!

https://github.com/porkcoin/porkcoin/commit/b880899e172ba3e77e4cca453bd1ea78e74d6b73

Code:
    QTime time= QTime::currentTime();
    qsrand(time.msec()+time.second()*1000);
    int xxx=qrand()%160;
if someone has different clock, this xxx will be different!!!

anyway, after the coin is launched, do not change anything, except code tweaks.
hero member
Activity: 780
Merit: 501
Setting up a pool is not possible with this coin due to the requirement of a Qt library in the PoW section of the code:

https://github.com/porkcoin/porkcoin/blob/master/src/main.cpp#L938
Code:
#include 
static const int CUTOFF_HEIGHT = POW_CUTOFF_HEIGHT;
// miner's coin base reward based on nBits
int64 GetProofOfWorkReward(int nHeight, int64 nFees, uint256 prevHash)
{
int64 nSubsidy = 1 * COIN;
QTime time= QTime::currentTime();
qsrand(time.msec()+time.second()*1000);
int xxx=qrand()%160;


    if(nHeight == 1)
    {
        nSubsidy = 100000 * COIN;
    }else
    if(nHeight < 10000)
    {
        if(nHeight % (160 + xxx) ==0) nSubsidy = 1024 * COIN;
            else
        nSubsidy = 1 * COIN;
    }else  if(nHeight > 10000 && nHeight < 20000 )
    {       
         if(nHeight % (160 + xxx) ==0) nSubsidy = 512 * COIN;
             else
         nSubsidy = 1 * COIN;
    }else  if(nHeight > 20000 && nHeight < 40000 )
    {
         if(nHeight % (160 + xxx) ==0) nSubsidy = 256 * COIN;
             else
         nSubsidy = 1 * COIN;
    }else   if(nHeight > 40000 && nHeight < 80000 )
    {
         if(nHeight % (160 + xxx) ==0) nSubsidy = 128 * COIN;
             else
         nSubsidy = 1 * COIN;
    }
    else   if(nHeight > 80000 && nHeight < 160000 )
    {
         if(nHeight % (160 + xxx) ==0) nSubsidy = 64 * COIN;
             else
         nSubsidy = 1 * COIN;
    }
    else   if(nHeight > 160000 && nHeight < 320000 )
    {
         if(nHeight % (160 + xxx) ==0) nSubsidy = 32 * COIN;
             else
         nSubsidy = 1 * COIN;
    }
    else   if(nHeight > 320000 && nHeight < 640000 )
    {
         if(nHeight % (160 + xxx) ==0) nSubsidy = 16 * COIN;
             else
         nSubsidy = 1 * COIN;
    }else     if(nHeight >  640000 )
    {
         if(nHeight % (160 + xxx) ==0) nSubsidy = 8 * COIN;
             else
         nSubsidy = 1 * COIN;
    }

This is poorly programmed in my opinion.  The developer needs to review/fix this code.
hero member
Activity: 780
Merit: 501
The source code on Github is incomplete

Code:
c++: warning: cannot open ../share/genbuild.sh: No such file or directory

Missing the 'share' folder.
I can't build the wallet or setup a mining pool until that is fixed.
hero member
Activity: 780
Merit: 501
We need a pool now!

I can set one up, but I'm still suspicious.
Why ? As far as i can see, it is not perfect but still normal X11 coin, like others .

I agree, it looks normal.  So did Nanite.
legendary
Activity: 1134
Merit: 1000
www.cryptodesign.cc
We need a pool now!

I can set one up, but I'm still suspicious.
Why ? As far as i can see, it is not perfect but still normal X11 coin, like others .
hero member
Activity: 780
Merit: 501
We need a pool now!

I can set one up, but I'm still suspicious.
legendary
Activity: 1134
Merit: 1000
www.cryptodesign.cc
We need a pool now!
sr. member
Activity: 426
Merit: 250
excange soon??
full member
Activity: 207
Merit: 100


fixed   the   bug

https://mega.co.nz/#!3MNx0LQZ!FjeMpGcuSwzdH5Fn9HS8VcunuWXRQ8dYuB2FyG9OPEc
hero member
Activity: 780
Merit: 501
Looks interesting but... it has many parallels to Nanite.
full member
Activity: 207
Merit: 100
And finally wallet synced! with rpc port: 9442





but in my all vps . it  is still  1267.

I don't know how to solve

Pages:
Jump to: