diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 8970f934d..8e9af6a04 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -694,15 +694,22 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } prevtotal = total; } - if ( overflow != 0 || total > COIN/10 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 ) { - //fprintf(stderr,">>>>>>>> <<<<<<<<<< ht.%d illegal nonz output %.8f n.%d\n",height,dstr(block.vtx[0].vout[1].nValue),n); - if ( height >= 235300 ) + if ( overflow != 0 || total > COIN/10 ) + { + //fprintf(stderr,">>>>>>>> <<<<<<<<<< ht.%d illegal nonz output %.8f n.%d\n",height,dstr(block.vtx[0].vout[1].nValue),n); + if ( height >= 235300 ) + return(-1); + } + } + else + { + if ( overflow != 0 || total > 0 ) return(-1); } return(0); } - //fprintf(stderr,"ht.%d n.%d nValue %.8f (%d %d %d)\n",height,n,dstr(block.vtx[0].vout[1].nValue),KOMODO_PAX,komodo_isrealtime(&ht),KOMODO_PASSPORT_INITDONE); offset += komodo_scriptitemlen(&opretlen,&script[offset]); if ( ASSETCHAINS_SYMBOL[0] == 0 ) @@ -745,7 +752,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); if ( baseid == USD ) // 6820 in balance calcs { - if ( height <= 2000 || height == 2968 || height == 2960 || height == 2649 || height == 3275 || height == 3282 || height == 3328 || height == 3468 ) + if ( height <= 6821 || height <= 2000 || height == 2968 || height == 2960 || height == 2649 || height == 3275 || height == 3282 || height == 3328 || height == 3468 ) return(0); } else if ( baseid == EUR ) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 2aa745070..0d11992ab 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -75,6 +75,8 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin { if ( minutes > 365 * 24 * 60 ) minutes = 365 * 24 * 60; + if ( txheight >= 275000 ) + minutes -= 59; denominator = (((uint64_t)365 * 24 * 60) / minutes); if ( denominator == 0 ) denominator = 1; // max KOMODO_INTEREST per transfer, do it at least annually! @@ -104,7 +106,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin if ( exception == 0 ) { numerator = (nValue / 20); // assumes 5%! - if ( txheight < 300000 ) + if ( txheight < 275000 ) interest = (numerator / denominator); else interest = (numerator * minutes) / ((uint64_t)365 * 24 * 60); } @@ -117,7 +119,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin else { numerator = (nValue * KOMODO_INTEREST); - if ( txheight < 300000 || numerator * minutes < 365 * 24 * 60 ) + if ( txheight < 275000 || numerator * minutes < 365 * 24 * 60 ) interest = (numerator / denominator) / COIN; else interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)) / COIN; } diff --git a/src/main.cpp b/src/main.cpp index 3ce70ef79..992425f3e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -708,12 +708,23 @@ bool IsStandardTx(const CTransaction& tx, string& reason) bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) { + static uin32_t grandfathered[] = + { + 1477262681, 1477262990, 1477598030, 1477269321, 1480625490, 1482008580, 1485678643, 1485972116, 1486039258, 1486096477, 1486159886, 1486236495, 1486305013, 1486390414, 1486390791, 1486391232, 1486395617, 1486415304, 1486439074, 1486507244, 1486536946, 1486766037, 1486766559, 1486768230, 1486768294, 1487355181, 1487356312, 1487449891, 1487467926, 1487614001, 1487639158, 1489298992, 1489299229, 1489299737, 1489299939, 1489300155, 1489300326, 1489300370, 1489408020, 1489408285, 1489438206, 1489463334, 1489519879, 1489519942, 1489519818, 1489597387, 1489663030, 1489687820, 1489796259, 1489838437, 1489847404, 1490022684 + }; + int32_t i; if (tx.nLockTime == 0) return true; - if ( ASSETCHAINS_SYMBOL[0] == 0 && nBlockTime != 1477598030 && nBlockTime != 1477269321 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - fprintf(stderr,"IsFinalTx reject locktime %u vs nBlockTime %u\n",tx.nLockTime,(uint32_t)nBlockTime); - return(false); // need to prevent pastdating tx + for (i=0; i