Add ac_period

This commit is contained in:
blackjok3r
2018-12-14 17:36:15 +08:00
parent 1325c90a5b
commit 4354549544
3 changed files with 33 additions and 26 deletions

View File

@@ -1068,7 +1068,7 @@ uint64_t komodo_block_prg(uint32_t nHeight)
// given a block height, this returns the unlock time for that block height, derived from
// the ASSETCHAINS_MAGIC number as well as the block height, providing different random numbers
// for corresponding blocks across chains, but the same sequence in each chain
// for corresponding blocks across chains, but the same sequence in each chain
int64_t komodo_block_unlocktime(uint32_t nHeight)
{
uint64_t fromTime, toTime, unlocktime;
@@ -1604,7 +1604,7 @@ uint64_t komodo_ac_block_subsidy(int nHeight)
subsidyDifference = subsidy;
}
else
{
{
// Ex: -ac_eras=3 -ac_reward=0,384,24 -ac_end=1440,260640,0 -ac_halving=1,1440,2103840 -ac_decay 100000000,97750000,0
subsidyDifference = subsidy - ASSETCHAINS_REWARD[curEra + 1];
if (subsidyDifference < 0)
@@ -1770,6 +1770,8 @@ void komodo_args(char *argv0)
ASSETCHAINS_COMMISSION = GetArg("-ac_perc",0);
ASSETCHAINS_OVERRIDE_PUBKEY = GetArg("-ac_pubkey","");
ASSETCHAINS_SCRIPTPUB = GetArg("-ac_script","");
ASSETCHAINS_FOUNDERS_PERIOD = GetArg("-ac_period",0);
if ( (ASSETCHAINS_STAKED= GetArg("-ac_staked",0)) > 100 )
ASSETCHAINS_STAKED = 100;
@@ -1777,7 +1779,7 @@ void komodo_args(char *argv0)
// other values
if ( (ASSETCHAINS_LWMAPOS = GetArg("-ac_veruspos",0)) != 0 )
ASSETCHAINS_LWMAPOS = 50;
ASSETCHAINS_SAPLING = GetArg("-ac_sapling", -1);
if (ASSETCHAINS_SAPLING == -1)
{
@@ -1870,7 +1872,11 @@ void komodo_args(char *argv0)
val = ASSETCHAINS_COMMISSION | (((uint64_t)ASSETCHAINS_STAKED & 0xff) << 32) | (((uint64_t)ASSETCHAINS_CC & 0xffff) << 40) | ((ASSETCHAINS_PUBLIC != 0) << 7) | ((ASSETCHAINS_PRIVATE != 0) << 6) | ASSETCHAINS_TXPOW;
extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(val),(void *)&val);
if ( ASSETCHAINS_FOUNDERS != 0 )
{
extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_FOUNDERS),(void *)&ASSETCHAINS_FOUNDERS);
if ( ASSETCHAINS_FOUNDERS_PERIOD != 0 )
extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_FOUNDERS_PERIOD),(void *)&ASSETCHAINS_FOUNDERS_PERIOD);
}
if ( ASSETCHAINS_SCRIPTPUB.size() > 1 )
extralen += iguana_rwnum(1,&extraptr[extralen],(int32_t)ASSETCHAINS_SCRIPTPUB.size(),(void *)ASSETCHAINS_SCRIPTPUB.c_str());
}
@@ -2051,4 +2057,3 @@ void komodo_prefetch(FILE *fp)
}
fseek(fp,fpos,SEEK_SET);
}