Post
Topic
Board Announcements (Altcoins)
Re: [ANN][YAC] yacoin: yet another altcoin. START is now.
by
dreamwatcher
on 08/05/2013, 20:22:05 UTC
I also believe the OP may be a bit BIP incompliant.

I do not see an RPC command or a Field in getwork - getworkex or getblocktemplate that gives the current Nfactor.

I may be wrong and missed it, but withholding vital mining information from RPC is ,shall we say "dirty pool"   Wink

Here is where it's calculated in the source
Code:
// yacoin: increasing Nfactor gradually
const unsigned char minNfactor = 4;
const unsigned char maxNfactor = 30;

unsigned char GetNfactor(int64 nTimestamp) {
    int l = 0;

    if (nTimestamp <= nChainStartTime)
        return 4;

    int64 s = nTimestamp - nChainStartTime;
    while ((s >> 1) > 3) {
      l += 1;
      s >>= 1;
    }

    s &= 3;

    int n = (l * 170 + s * 25 - 2320) / 100;

    if (n < 0) n = 0;

    if (n > 255)
        printf("GetNfactor(%d) - something wrong(n == %d)\n", nTimestamp, n);

    unsigned char N = (unsigned char)n;
    //printf("GetNfactor: %d -> %d %d : %d / %d\n", nTimestamp - nChainStartTime, l, s, n, min(max(N, minNfactor), maxNfactor));

    return min(max(N, minNfactor), maxNfactor);
}

Yep, I saw that, I have it pasted to a note sheet along with other snipets.

I guess I am going to make a patch and add an rpc command to get the Nfactor.