Post
Topic
Board Announcements (Altcoins)
Re: [ANN] [HIRO] Hirocoin Takeover + New Development + updates! v0.8.8.1
by
sawa
on 10/09/2017, 09:51:01 UTC
I see that block explorer https://cryptobe.com/chain/HiroCoin shows that the blocks with payment of 100HIRO are found.
I decided to analyze the last blocks on my node: http://crypto.mine.nu:9408 and in the block explorer https://cryptobe.com/chain/HiroCoin
And I see that HiroCoin blockchain has divided into 2 branches.

Proceeding from the function of calculating subsidies:
https://github.com/Hirocoin/hirocoin/blob/ef74937b92fedd35d43be1af970ab06fd74a3b09/src/main.cpp#L1064

Code:
// PoW Miner Subsidy Function
int64 static GetBlockValue(const CBlockIndex* pindexLast, int64 nFees, bool addOne)
{
    int nHeight = pindexLast->nHeight;
    int mockSubsidy = 400;
    if (addOne) {nHeight += 1;}
    if (nHeight > nVolatileSubsidyFork) {
        if (!addOne) pindexLast = pindexLast->pprev;
        const CBlockIndex* pindexFirst = pindexLast;
        mockSubsidy = 200;
        double diffTotal = 0;
        double lastDiff = GetDifficulty(pindexLast);
        for (int i = 0; pindexFirst && i < 100; i++) {
            pindexFirst = pindexFirst->pprev;
            diffTotal += GetDifficulty(pindexFirst);
        }
        double weight = (diffTotal / 100) / lastDiff;
        if (weight > 2) weight = 2; // Max 400 reward
        if (weight < 0.2) weight = 0.2; // Min 40 reward
        mockSubsidy *= weight;
    }
    // Mining Phase Subsidy
    int64 nSubsidy = mockSubsidy * COIN;
    // Mining Halving Phase
    if (nHeight < nHalvingEnd)
    {
        nSubsidy >>= (nHeight / nHalvingBlock);
    }
    // Mineout Phase Subsidy
    else if (nHeight >= nMineoutBlock)
    {
    nSubsidy = nMineoutBlockSubsidy;
    }
    // Invalid Protection
    else nSubsidy = nBlockRewardInvalid;

    return nSubsidy + nFees;
}

For example, I take a 1712775 block
https://cryptobe.com/block/0000000034c12cf4e6420571f50bbe42479ae59c0caad4cdb47c17a1fbe3afcc

The condition "if (nHeight nHalvingEnd now.
nHeight = 1712775
nHalvingEnd = 1680000 (look here https://github.com/Hirocoin/hirocoin/blob/ef74937b92fedd35d43be1af970ab06fd74a3b09/src/main.h#L75)

So then this comparison should be performed:
else if (nHeight> = nMineoutBlock)
Since nMineoutBlock = 2978250 (look here https://github.com/Hirocoin/hirocoin/blob/ef74937b92fedd35d43be1af970ab06fd74a3b09/src/main.h#L77)
it is false, and the subsidy should be equal to 0.0001:
nSubsidy = nBlockRewardInvalid
nBlockRewardInvalid = 0.0001 (look here https://github.com/Hirocoin/hirocoin/blob/ef74937b92fedd35d43be1af970ab06fd74a3b09/src/main.h#L71)

I do not understand why the payout shown in the block explorer for this block is 100. If I got it right, the subsidy for the blocks from 1680000 to 2978249 should be 0.0001HIRO

On my node I receive a payment of 0.0001HIRO for the block.
Then what do I see in the block explorer?
Or did I misunderstand the function?