Browse Source

KOMODO_ENDOFERA

pull/4/head
jl777 7 years ago
parent
commit
314350e695
  1. 1
      src/komodo.h
  2. 8
      src/komodo_interest.h
  3. 8
      src/main.cpp

1
src/komodo.h

@ -25,6 +25,7 @@
#define KOMODO_ASSETCHAINS_WAITNOTARIZE
#define KOMODO_PAXMAX (10000 * COIN)
#define KOMODO_ENDOFERA 7777777
#include <stdint.h>
#include <stdio.h>

8
src/komodo_interest.h

@ -19,6 +19,7 @@
#define KOMODO_INTEREST ((uint64_t)(0.05 * COIN)) // 5%
int64_t MAX_MONEY = 200000000 * 100000000LL;
#ifdef notanymore
uint64_t komodo_earned_interest(int32_t height,int64_t paidinterest)
{
static uint64_t *interests; static int32_t maxheight;
@ -73,6 +74,7 @@ uint64_t komodo_moneysupply(int32_t height)
return(0);
else return(COIN * 100000000 + (height-1) * 3 + komodo_earned_interest(height,-1));
}
#endif
uint64_t _komodo_interestnew(uint64_t nValue,uint32_t nLockTime,uint32_t tiptime)
{
@ -90,7 +92,7 @@ uint64_t _komodo_interestnew(uint64_t nValue,uint32_t nLockTime,uint32_t tiptime
uint64_t komodo_interestnew(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uint32_t tiptime)
{
uint64_t interest = 0;
if ( txheight < 7777777 && komodo_moneysupply(txheight) < MAX_MONEY && nLockTime >= LOCKTIME_THRESHOLD && tiptime != 0 && nLockTime < tiptime && nValue >= 10*COIN )
if ( txheight < KOMODO_ENDOFERA && nLockTime >= LOCKTIME_THRESHOLD && tiptime != 0 && nLockTime < tiptime && nValue >= 10*COIN ) //komodo_moneysupply(txheight) < MAX_MONEY &&
interest = _komodo_interestnew(nValue,nLockTime,tiptime);
return(interest);
}
@ -101,9 +103,9 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin
activation = 1491350400; // 1491350400 5th April
if ( ASSETCHAINS_SYMBOL[0] != 0 )
return(0);
if ( txheight >= 7777777 )
if ( txheight >= KOMODO_ENDOFERA )
return(0);
if ( komodo_moneysupply(txheight) < MAX_MONEY && nLockTime >= LOCKTIME_THRESHOLD && tiptime != 0 && nLockTime < tiptime && nValue >= 10*COIN )
if ( nLockTime >= LOCKTIME_THRESHOLD && tiptime != 0 && nLockTime < tiptime && nValue >= 10*COIN ) //komodo_moneysupply(txheight) < MAX_MONEY &&
{
if ( (minutes= (tiptime - nLockTime) / 60) >= 60 )
{

8
src/main.cpp

@ -1490,7 +1490,7 @@ bool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex)
return true;
}
uint64_t komodo_moneysupply(int32_t height);
//uint64_t komodo_moneysupply(int32_t height);
extern char ASSETCHAINS_SYMBOL[16];
extern uint32_t ASSETCHAINS_MAGIC;
extern uint64_t ASSETCHAINS_SUPPLY;
@ -1502,7 +1502,7 @@ CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
{
if ( nHeight == 1 )
return(100000000 * COIN); // ICO allocation
else if ( komodo_moneysupply(nHeight) < MAX_MONEY )
else if ( nHeight < KOMODO_ENDOFERA ) //komodo_moneysupply(nHeight) < MAX_MONEY )
return(3 * COIN);
else return(0);
}
@ -2365,8 +2365,8 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
return false;
control.Add(vChecks);
}
if ( ASSETCHAINS_SYMBOL[0] == 0 )
komodo_earned_interest(pindex->nHeight,sum);
//if ( ASSETCHAINS_SYMBOL[0] == 0 )
// komodo_earned_interest(pindex->nHeight,sum);
CTxUndo undoDummy;
if (i > 0) {
blockundo.vtxundo.push_back(CTxUndo());

Loading…
Cancel
Save