Post
Topic
Board Announcements (Altcoins)
Re: [ANN] STRAKS - Decentralised, Open Source, Community Driven Digital Currency
by
UtopianMessiah
on 21/04/2018, 21:20:41 UTC
Hi guys,

Having trouble setting up the Treasury funding for STAK,
Using Unomp as stratum, and have set the rewardreceipent to 0.5 to address : 3K3bPrW5h7DYEMp2RcXawTCXajcm4ZU9Zh
But On finding a block, I still get the error: ERROR: ConnectBlock: treasury funding missing .

Which leads to this part of the source code:

// TREASURY Funding
    if(pindex->nHeight > 0) {
        // Coinbase transaction must include an output sending 5% of
        // the block reward to a treasury
        bool found = false;
        const CTransaction &tx = *(block.vtx[0]);

        CAmount treasuryVal = GetBlockSubsidy(
            pindex->nHeight, chainparams.GetConsensus()) * 0.05;

        // slow start - instamine protection
        if(pindex->nHeight <= PRE_SUBSIDY_HEIGHT)
            treasuryVal = 0.0;

        BOOST_FOREACH(const CTxOut& output, tx.vout) {
            if (output.scriptPubKey ==
                    Params().GetTreasuryRewardScriptAtHeight(pindex->nHeight))
            {
                if (output.nValue == treasuryVal) {
                    found = true;
                    break;
                }
            }
        }

        if (!found) {
            if(fDebug) LogPrintf("[squbs] ** rejecting block - treasury funding missing! **\n");
            return state.DoS(100, error("%s: treasury funding missing", __func__), REJECT_INVALID, "cb-no-treasury-funding");
        }
    }

What is the right approach here to get the treasury funding correct?

There are 4 treasury addresses, modulo 4.  That might be your issue.