From 9f319c1cc9d87264fa6a3a6fda435ddd69a2e2f4 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Sun, 6 Dec 2020 22:45:54 -0500 Subject: [PATCH] the commission is the mission --- src/komodo_bitcoind.h | 4 ++-- src/main.cpp | 2 +- src/miner.cpp | 4 ++-- src/rpc/mining.cpp | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 8909074eb..b315842dc 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1348,7 +1348,7 @@ uint64_t hush_commission(int height) return commission; } -uint64_t komodo_commission(const CBlock *pblock,int32_t height) +uint64_t the_commission(const CBlock *pblock,int32_t height) { //fprintf(stderr,"%s at height=%d\n",__func__,height); static bool didinit = false, ishush3 = false; @@ -2064,7 +2064,7 @@ int64_t komodo_checkcommission(CBlock *pblock,int32_t height) int64_t checktoshis=0; uint8_t *script,scripthex[8192]; int32_t scriptlen,matched = 0; static bool didinit = false; if ( ASSETCHAINS_COMMISSION != 0 || ASSETCHAINS_FOUNDERS_REWARD != 0 ) { - checktoshis = komodo_commission(pblock,height); + checktoshis = the_commission(pblock,height); if ( checktoshis >= 10000 && pblock->vtx[0].vout.size() < 2 ) { fprintf(stderr,"ERROR: komodo_checkcommission vsize.%d height.%d commission %.8f has checktoshis=%lu <10000 or less than 2 vouts (vouts=%lu)\n",(int32_t)pblock->vtx[0].vout.size(),height,(double)checktoshis/COIN, checktoshis, pblock->vtx[0].vout.size() ); diff --git a/src/main.cpp b/src/main.cpp index 5526b2f57..918845357 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3671,7 +3671,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin if ( ASSETCHAINS_COMMISSION != 0 || ASSETCHAINS_FOUNDERS_REWARD != 0 ) //ASSETCHAINS_OVERRIDE_PUBKEY33[0] != 0 && { uint64_t checktoshis; - if ( (checktoshis= komodo_commission((CBlock *)&block,(int32_t)pindex->GetHeight())) != 0 ) + if ( (checktoshis= the_commission((CBlock *)&block,(int32_t)pindex->GetHeight())) != 0 ) { if ( block.vtx[0].vout.size() >= 2 && block.vtx[0].vout[1].nValue == checktoshis ) blockReward += checktoshis; diff --git a/src/miner.cpp b/src/miner.cpp index 30c6196eb..7868f4b34 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -147,7 +147,7 @@ int32_t komodo_baseid(char *origbase); int32_t hush_longestchain(); int32_t komodo_validate_interest(const CTransaction &tx,int32_t txheight,uint32_t nTime,int32_t dispflag); int64_t komodo_block_unlocktime(uint32_t nHeight); -uint64_t komodo_commission(const CBlock *block,int32_t height); +uint64_t the_commission(const CBlock *block,int32_t height); int32_t komodo_notaryvin(CMutableTransaction &txNew,uint8_t *notarypub33, void *ptr); int32_t decode_hex(uint8_t *bytes,int32_t n,char *hex); int32_t komodo_is_notarytx(const CTransaction& tx); @@ -630,7 +630,7 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 txNew.vout[0].nValue += 5000; pblock->vtx[0] = txNew; - if ( nHeight > 1 && SMART_CHAIN_SYMBOL[0] != 0 && (ASSETCHAINS_OVERRIDE_PUBKEY33[0] != 0 || ASSETCHAINS_SCRIPTPUB.size() > 1) && (ASSETCHAINS_COMMISSION != 0 || ASSETCHAINS_FOUNDERS_REWARD != 0) && (commission= komodo_commission((CBlock*)&pblocktemplate->block,(int32_t)nHeight)) != 0 ) + if ( nHeight > 1 && SMART_CHAIN_SYMBOL[0] != 0 && (ASSETCHAINS_OVERRIDE_PUBKEY33[0] != 0 || ASSETCHAINS_SCRIPTPUB.size() > 1) && (ASSETCHAINS_COMMISSION != 0 || ASSETCHAINS_FOUNDERS_REWARD != 0) && (commission= the_commission((CBlock*)&pblocktemplate->block,(int32_t)nHeight)) != 0 ) { int32_t i; uint8_t *ptr; txNew.vout.resize(2); diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 3ccf12de8..8eff961e8 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -52,7 +52,7 @@ using namespace std; #include "hush_defs.h" extern int32_t ASSETCHAINS_FOUNDERS; -uint64_t komodo_commission(const CBlock *pblock,int32_t height); +uint64_t the_commission(const CBlock *pblock,int32_t height); int32_t komodo_blockload(CBlock& block,CBlockIndex *pindex); arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t height,int32_t goalperc); @@ -1048,13 +1048,13 @@ UniValue getblocksubsidy(const UniValue& params, bool fHelp, const CPubKey& mypk CBlockIndex* pblockIndex = chainActive[nHeight]; CBlock block; if ( komodo_blockload(block, pblockIndex) == 0 ) - nFoundersReward = komodo_commission(&block, nHeight); + nFoundersReward = the_commission(&block, nHeight); } } else if ( ASSETCHAINS_FOUNDERS != 0 ) { // Assetchains founders chains have a fixed reward so can be calculated at any given height. - nFoundersReward = komodo_commission(0, nHeight); + nFoundersReward = the_commission(0, nHeight); } result.push_back(Pair("ac_pubkey", ValueFromAmount(nFoundersReward))); }