We have 30 years to properly fix this bug, ain't got time now

Revert "Chasing a last block reward bug"

This reverts commit 034003c8d6.
This commit is contained in:
Jonathan "Duke" Leto
2019-04-13 18:00:49 +02:00
parent 034003c8d6
commit 38f5f34d7b

View File

@@ -1219,23 +1219,11 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height)
// NOTE: ac_end specifies the first block with 0 reward, not the last block with a reward! // NOTE: ac_end specifies the first block with 0 reward, not the last block with a reward!
//int32_t starting_commission = 125000000, HALVING1 = 340000, INTERVAL = 840000, TRANSITION = 129, BR_END = 5422111; //int32_t starting_commission = 125000000, HALVING1 = 340000, INTERVAL = 840000, TRANSITION = 129, BR_END = 5422111;
// testnet values // testnet values
int64_t starting_commission = 125000000, HALVING1 = 34, INTERVAL = 84, TRANSITION = 29, BR_END=501; int64_t starting_commission = 125000000, HALVING1 = 34, INTERVAL = 84, TRANSITION = 29;
nSubsidy = GetBlockSubsidy(height,Params().GetConsensus()); nSubsidy = GetBlockSubsidy(height,Params().GetConsensus());
commission = ((nSubsidy * ASSETCHAINS_COMMISSION) / COIN); commission = ((nSubsidy * ASSETCHAINS_COMMISSION) / COIN);
//fprintf(stderr,"ORIG ht.%d nSubsidy %.8f prod %llu\n",height,(double)nSubsidy/COIN,(long long)(nSubsidy * ASSETCHAINS_COMMISSION)); //fprintf(stderr,"ORIG ht.%d nSubsidy %.8f prod %llu\n",height,(double)nSubsidy/COIN,(long long)(nSubsidy * ASSETCHAINS_COMMISSION));
if ( ASSETCHAINS_FOUNDERS > 1 )
{
if ( (height % ASSETCHAINS_FOUNDERS) == 0 )
{
if ( ASSETCHAINS_FOUNDERS_REWARD == 0 )
commission = commission * ASSETCHAINS_FOUNDERS;
else
commission = ASSETCHAINS_FOUNDERS_REWARD;
}
else commission = 0;
}
if ((strcmp(ASSETCHAINS_SYMBOL, "HUSH") != 0) || (strcmp(ASSETCHAINS_SYMBOL, "HUSHT7") != 0)) { if ((strcmp(ASSETCHAINS_SYMBOL, "HUSH") != 0) || (strcmp(ASSETCHAINS_SYMBOL, "HUSHT7") != 0)) {
// HUSH supply curve cannot be exactly represented via KMD AC CLI args, so we do it ourselves. // HUSH supply curve cannot be exactly represented via KMD AC CLI args, so we do it ourselves.
// You specify the BR, and the FR % gets added so 10% of 12.5 is 1.25 // You specify the BR, and the FR % gets added so 10% of 12.5 is 1.25
@@ -1262,11 +1250,19 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height)
} else if (height < HALVING1+7*INTERVAL) { } else if (height < HALVING1+7*INTERVAL) {
commission = starting_commission / 128; // Block 6220000 commission = starting_commission / 128; // Block 6220000
} }
}
//fprintf(stderr,"AFTER ht.%d nSubsidy %.8f prod %llu\n",height,(double)nSubsidy/COIN,(long long)(nSubsidy * ASSETCHAINS_COMMISSION));
if (height >= BR_END) { if ( ASSETCHAINS_FOUNDERS > 1 )
fprintf(stderr,"Forcing commission=0\n"); {
commission = 0; if ( (height % ASSETCHAINS_FOUNDERS) == 0 )
{
if ( ASSETCHAINS_FOUNDERS_REWARD == 0 )
commission = commission * ASSETCHAINS_FOUNDERS;
else
commission = ASSETCHAINS_FOUNDERS_REWARD;
} }
else commission = 0;
} }
} }
else else