Billion at a time
This commit is contained in:
@@ -266,6 +266,8 @@ uint64_t komodo_current_supply(uint32_t nHeight)
|
||||
}
|
||||
#define KOMODO_MAXNVALUE (((uint64_t)1 << 63) - 1)
|
||||
#define KOMODO_BIT63SET(x) ((x) & ((uint64_t)1 << 63))
|
||||
#define KOMODO_VALUETOOBIG(x) ((x) > (uint64_t)10000000000)
|
||||
|
||||
if ( KOMODO_BIT63SET(cur_money) != 0 )
|
||||
return(KOMODO_MAXNVALUE);
|
||||
if ( ASSETCHAINS_COMMISSION != 0 )
|
||||
|
||||
@@ -1639,9 +1639,18 @@ uint64_t komodo_ac_block_subsidy(int nHeight)
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( nHeight == 1 )
|
||||
uint32_t magicExtra = ASSETCHAINS_STAKED ? ASSETCHAINS_MAGIC : (ASSETCHAINS_MAGIC & 0xffffff);
|
||||
if ( ASSETCHAINS_SUPPLY > 1000000000 )
|
||||
{
|
||||
if ( nHeight <= ASSETCHAINS_SUPPLY/1000000000 )
|
||||
{
|
||||
subsidy = (uint64_t)1000000000 * COIN;
|
||||
if ( nHeight == 1 )
|
||||
subsidy += magicExtra;
|
||||
}
|
||||
}
|
||||
else if ( nHeight == 1 )
|
||||
{
|
||||
uint32_t magicExtra = ASSETCHAINS_STAKED ? ASSETCHAINS_MAGIC : (ASSETCHAINS_MAGIC & 0xffffff);
|
||||
if ( ASSETCHAINS_LASTERA == 0 )
|
||||
subsidy = ASSETCHAINS_SUPPLY * SATOSHIDEN + magicExtra;
|
||||
else
|
||||
|
||||
@@ -1808,7 +1808,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
|
||||
CAmount nValueOut = tx.GetValueOut();
|
||||
CAmount nFees = nValueIn-nValueOut;
|
||||
double dPriority = view.GetPriority(tx, chainActive.Height());
|
||||
if ( KOMODO_BIT63SET(nValueOut) != 0 )
|
||||
if ( KOMODO_VALUETOOBIG(nValueOut) != 0 )
|
||||
return state.DoS(100, error("AcceptToMemoryPool: GetValueOut too big"),REJECT_INVALID,"tx valueout is too big");
|
||||
|
||||
// Keep track of transactions that spend a coinbase, which we re-scan
|
||||
@@ -3494,11 +3494,11 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
|
||||
txdata.emplace_back(tx);
|
||||
|
||||
valueout = tx.GetValueOut();
|
||||
if ( KOMODO_BIT63SET(valueout) != 0 )
|
||||
if ( KOMODO_VALUETOOBIG(valueout) != 0 )
|
||||
return state.DoS(100, error("ConnectBlock(): GetValueOut too big"),REJECT_INVALID,"tx valueout is too big");
|
||||
prevsum = voutsum;
|
||||
voutsum += valueout;
|
||||
if ( KOMODO_BIT63SET(voutsum) != 0 )
|
||||
if ( KOMODO_VALUETOOBIG(voutsum) != 0 )
|
||||
{
|
||||
fprintf(stderr,"voutsum %.8f too big\n",(double)voutsum/COIN);
|
||||
return state.DoS(100, error("ConnectBlock(): voutsum too big"),REJECT_INVALID,"tx valueout is too big");
|
||||
|
||||
Reference in New Issue
Block a user