the commission is the mission
This commit is contained in:
@@ -1348,7 +1348,7 @@ uint64_t hush_commission(int height)
|
|||||||
return commission;
|
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);
|
//fprintf(stderr,"%s at height=%d\n",__func__,height);
|
||||||
static bool didinit = false, ishush3 = false;
|
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;
|
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 )
|
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 )
|
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() );
|
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() );
|
||||||
|
|||||||
@@ -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 &&
|
if ( ASSETCHAINS_COMMISSION != 0 || ASSETCHAINS_FOUNDERS_REWARD != 0 ) //ASSETCHAINS_OVERRIDE_PUBKEY33[0] != 0 &&
|
||||||
{
|
{
|
||||||
uint64_t checktoshis;
|
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 )
|
if ( block.vtx[0].vout.size() >= 2 && block.vtx[0].vout[1].nValue == checktoshis )
|
||||||
blockReward += checktoshis;
|
blockReward += checktoshis;
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ int32_t komodo_baseid(char *origbase);
|
|||||||
int32_t hush_longestchain();
|
int32_t hush_longestchain();
|
||||||
int32_t komodo_validate_interest(const CTransaction &tx,int32_t txheight,uint32_t nTime,int32_t dispflag);
|
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);
|
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 komodo_notaryvin(CMutableTransaction &txNew,uint8_t *notarypub33, void *ptr);
|
||||||
int32_t decode_hex(uint8_t *bytes,int32_t n,char *hex);
|
int32_t decode_hex(uint8_t *bytes,int32_t n,char *hex);
|
||||||
int32_t komodo_is_notarytx(const CTransaction& tx);
|
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;
|
txNew.vout[0].nValue += 5000;
|
||||||
pblock->vtx[0] = txNew;
|
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;
|
int32_t i; uint8_t *ptr;
|
||||||
txNew.vout.resize(2);
|
txNew.vout.resize(2);
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ using namespace std;
|
|||||||
#include "hush_defs.h"
|
#include "hush_defs.h"
|
||||||
|
|
||||||
extern int32_t ASSETCHAINS_FOUNDERS;
|
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);
|
int32_t komodo_blockload(CBlock& block,CBlockIndex *pindex);
|
||||||
arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t height,int32_t goalperc);
|
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];
|
CBlockIndex* pblockIndex = chainActive[nHeight];
|
||||||
CBlock block;
|
CBlock block;
|
||||||
if ( komodo_blockload(block, pblockIndex) == 0 )
|
if ( komodo_blockload(block, pblockIndex) == 0 )
|
||||||
nFoundersReward = komodo_commission(&block, nHeight);
|
nFoundersReward = the_commission(&block, nHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( ASSETCHAINS_FOUNDERS != 0 )
|
else if ( ASSETCHAINS_FOUNDERS != 0 )
|
||||||
{
|
{
|
||||||
// Assetchains founders chains have a fixed reward so can be calculated at any given height.
|
// 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)));
|
result.push_back(Pair("ac_pubkey", ValueFromAmount(nFoundersReward)));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user