ac_founders_reward test for Alright

This commit is contained in:
blackjok3r
2019-01-20 19:11:31 +08:00
parent c2ce7ca9ce
commit f7b6af7b3f
3 changed files with 18 additions and 8 deletions

View File

@@ -1151,7 +1151,12 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height)
if ( ASSETCHAINS_FOUNDERS > 1 ) if ( ASSETCHAINS_FOUNDERS > 1 )
{ {
if ( (height % ASSETCHAINS_FOUNDERS) == 0 ) if ( (height % ASSETCHAINS_FOUNDERS) == 0 )
commission = commission * ASSETCHAINS_FOUNDERS; {
if ( ASSETCHAINS_FOUNDERS_REWARD == 0 )
commission = commission * ASSETCHAINS_FOUNDERS;
else
commission = ASSETCHAINS_FOUNDERS_REWARD;
}
else commission = 0; else commission = 0;
} }
} }

View File

@@ -92,7 +92,7 @@ int32_t ASSETCHAINS_SAPLING = -1;
int32_t ASSETCHAINS_OVERWINTER = -1; int32_t ASSETCHAINS_OVERWINTER = -1;
uint64_t KOMODO_INTERESTSUM,KOMODO_WALLETBALANCE; uint64_t KOMODO_INTERESTSUM,KOMODO_WALLETBALANCE;
uint64_t ASSETCHAINS_COMMISSION,ASSETCHAINS_STAKED,ASSETCHAINS_SUPPLY = 10,MIN_RECV_SATS; uint64_t ASSETCHAINS_COMMISSION,ASSETCHAINS_STAKED,ASSETCHAINS_SUPPLY = 10,MIN_RECV_SATS, ASSETCHAINS_FOUNDERS_REWARD;
uint32_t KOMODO_INITDONE; uint32_t KOMODO_INITDONE;
char KMDUSERPASS[8192+512+1],BTCUSERPASS[8192]; uint16_t KMD_PORT = 7771,BITCOIND_RPCPORT = 7771; char KMDUSERPASS[8192+512+1],BTCUSERPASS[8192]; uint16_t KMD_PORT = 7771,BITCOIND_RPCPORT = 7771;

View File

@@ -1777,6 +1777,7 @@ void komodo_args(char *argv0)
MAX_BLOCK_SIGOPS = 60000; MAX_BLOCK_SIGOPS = 60000;
ASSETCHAINS_TXPOW = GetArg("-ac_txpow",0) & 3; ASSETCHAINS_TXPOW = GetArg("-ac_txpow",0) & 3;
ASSETCHAINS_FOUNDERS = GetArg("-ac_founders",0);// & 1; ASSETCHAINS_FOUNDERS = GetArg("-ac_founders",0);// & 1;
ASSETCHAINS_FOUNDERS_REWARD = GetArg("-ac_founders_reward",0);
ASSETCHAINS_SUPPLY = GetArg("-ac_supply",10); ASSETCHAINS_SUPPLY = GetArg("-ac_supply",10);
ASSETCHAINS_COMMISSION = GetArg("-ac_perc",0); ASSETCHAINS_COMMISSION = GetArg("-ac_perc",0);
ASSETCHAINS_OVERRIDE_PUBKEY = GetArg("-ac_pubkey",""); ASSETCHAINS_OVERRIDE_PUBKEY = GetArg("-ac_pubkey","");
@@ -1835,13 +1836,17 @@ void komodo_args(char *argv0)
decode_hex(ASSETCHAINS_OVERRIDE_PUBKEY33,33,(char *)ASSETCHAINS_OVERRIDE_PUBKEY.c_str()); decode_hex(ASSETCHAINS_OVERRIDE_PUBKEY33,33,(char *)ASSETCHAINS_OVERRIDE_PUBKEY.c_str());
calc_rmd160_sha256(ASSETCHAINS_OVERRIDE_PUBKEYHASH,ASSETCHAINS_OVERRIDE_PUBKEY33,33); calc_rmd160_sha256(ASSETCHAINS_OVERRIDE_PUBKEYHASH,ASSETCHAINS_OVERRIDE_PUBKEY33,33);
} }
if ( ASSETCHAINS_COMMISSION == 0 ) if ( ASSETCHAINS_COMMISSION == 0 && ASSETCHAINS_FOUNDERS != 0 )
{ {
if (ASSETCHAINS_FOUNDERS != 0 ) if ( ASSETCHAINS_FOUNDERS_REWARD == 0 )
{ {
ASSETCHAINS_COMMISSION = 53846154; // maps to 35% ASSETCHAINS_COMMISSION = 53846154; // maps to 35%
printf("ASSETCHAINS_COMMISSION defaulted to 35%% when founders reward active\n"); printf("ASSETCHAINS_COMMISSION defaulted to 35%% when founders reward active\n");
} }
else
{
printf("ASSETCHAINS_FOUNDERS_REWARD set to %ld\n", ASSETCHAINS_FOUNDERS_REWARD);
}
/*else if ( ASSETCHAINS_SELFIMPORT.size() == 0 ) /*else if ( ASSETCHAINS_SELFIMPORT.size() == 0 )
{ {
//ASSETCHAINS_OVERRIDE_PUBKEY.clear(); //ASSETCHAINS_OVERRIDE_PUBKEY.clear();