diff --git a/src/cc/rewards.cpp b/src/cc/rewards.cpp index df1ab6871..9ff886212 100644 --- a/src/cc/rewards.cpp +++ b/src/cc/rewards.cpp @@ -89,7 +89,7 @@ uint64_t RewardsCalc(int64_t amount, uint256 txid, int64_t APR, int64_t minsecon reward = (((amount * APR) / COIN) * duration) / (365*24*3600LL * 100); else reward = (((amount * duration) / (365 * 24 * 3600LL)) * (APR / 1000000)) / 10000; */ - if ( !komodo_hardfork_active(timestamp) ) + if ( !hush_hardfork_active(timestamp) ) reward = (((amount * duration) / (365 * 24 * 3600LL)) * (APR / 1000000)) / 10000; else { diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 5e46960f1..2a5db1359 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -700,10 +700,12 @@ bool komodo_checkopret(CBlock *pblock, CScript &merkleroot) return(merkleroot.IsOpReturn() && merkleroot == komodo_makeopret(pblock, false)); } -bool komodo_hardfork_active(uint32_t time) +#define HUSH_HARDFORK1 (162000) + +bool hush_hardfork_active(uint32_t time) { - //TODO: set a block height for ~ Jan 21 3pm - return ( (ASSETCHAINS_SYMBOL[0] == 0 && chainActive.Height() > nDecemberHardforkHeight) || (ASSETCHAINS_SYMBOL[0] != 0 && time > nStakedDecemberHardforkTimestamp) ); //December 2019 hardfork + // Approximately mid-day Jan 21 EST + return ( chainActive.Height() > HUSH_HARDFORK1); } bool MarmaraPoScheck(char *destaddr,CScript opret,CTransaction staketx); diff --git a/src/komodo_defs.h b/src/komodo_defs.h index 93c91b041..ca098f4ab 100644 --- a/src/komodo_defs.h +++ b/src/komodo_defs.h @@ -419,7 +419,7 @@ uint64_t komodo_accrued_interest(int32_t *txheightp,uint32_t *locktimep,uint256 int32_t komodo_currentheight(); int32_t komodo_notarized_bracket(struct notarized_checkpoint *nps[2],int32_t height); arith_uint256 komodo_adaptivepow_target(int32_t height,arith_uint256 bnTarget,uint32_t nTime); -bool komodo_hardfork_active(uint32_t time); +bool hush_hardfork_active(uint32_t time); int32_t komodo_newStakerActive(int32_t height, uint32_t timestamp); uint256 Parseuint256(const char *hexstr); diff --git a/src/komodo_nSPV_wallet.h b/src/komodo_nSPV_wallet.h index f745629b7..09c590caa 100644 --- a/src/komodo_nSPV_wallet.h +++ b/src/komodo_nSPV_wallet.h @@ -389,7 +389,7 @@ UniValue NSPV_spend(char *srcaddr,char *destaddr,int64_t satoshis) // what its a mtx.nVersionGroupId = SAPLING_VERSION_GROUP_ID; mtx.nVersion = SAPLING_TX_VERSION; if ( ASSETCHAINS_SYMBOL[0] == 0 ) { - if ( !komodo_hardfork_active((uint32_t)chainActive.LastTip()->nTime) ) + if ( !hush_hardfork_active((uint32_t)chainActive.LastTip()->nTime) ) mtx.nLockTime = (uint32_t)time(NULL) - 777; else mtx.nLockTime = (uint32_t)chainActive.Tip()->GetMedianTimePast(); diff --git a/src/main.cpp b/src/main.cpp index 54e56d974..f2c5c0c69 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -936,7 +936,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) return true; BOOST_FOREACH(const CTxIn& txin, tx.vin) { - if ( !komodo_hardfork_active(nBlockTime) && txin.nSequence == 0xfffffffe && + if ( !hush_hardfork_active(nBlockTime) && txin.nSequence == 0xfffffffe && //if ( (nBlockTime <= ASSETCHAINS_STAKED_HF_TIMESTAMP ) && txin.nSequence == 0xfffffffe && ( ((int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime > nBlockTime) || @@ -947,7 +947,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) } //else if ( nBlockTime > ASSETCHAINS_STAKED_HF_TIMESTAMP && txin.nSequence == 0xfffffffe && - else if ( komodo_hardfork_active(nBlockTime) && txin.nSequence == 0xfffffffe && + else if ( hush_hardfork_active(nBlockTime) && txin.nSequence == 0xfffffffe && ( ((int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime <= nBlockTime) || ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime <= nBlockHeight)) diff --git a/src/wallet/asyncrpcoperation_sendmany.cpp b/src/wallet/asyncrpcoperation_sendmany.cpp index dca93461b..b857ca80b 100644 --- a/src/wallet/asyncrpcoperation_sendmany.cpp +++ b/src/wallet/asyncrpcoperation_sendmany.cpp @@ -57,7 +57,7 @@ extern char ASSETCHAINS_SYMBOL[65]; int32_t komodo_dpowconfs(int32_t height,int32_t numconfs); int32_t komodo_blockheight(uint256 hash); int tx_height( const uint256 &hash ); -bool komodo_hardfork_active(uint32_t time); +bool hush_hardfork_active(uint32_t time); extern UniValue signrawtransaction(const UniValue& params, bool fHelp, const CPubKey& mypk); extern UniValue sendrawtransaction(const UniValue& params, bool fHelp, const CPubKey& mypk); @@ -377,7 +377,7 @@ bool AsyncRPCOperation_sendmany::main_impl() { if (ASSETCHAINS_SYMBOL[0] == 0) { //if ((uint32_t)chainActive.LastTip()->nTime < ASSETCHAINS_STAKED_HF_TIMESTAMP) - if ( !komodo_hardfork_active((uint32_t)chainActive.LastTip()->nTime) ) + if ( !hush_hardfork_active((uint32_t)chainActive.LastTip()->nTime) ) builder_.SetLockTime((uint32_t)time(NULL) - 60); // set lock time for Komodo interest else builder_.SetLockTime((uint32_t)chainActive.Tip()->GetMedianTimePast()); @@ -394,7 +394,7 @@ bool AsyncRPCOperation_sendmany::main_impl() { if (ASSETCHAINS_SYMBOL[0] == 0) { //if ((uint32_t)chainActive.LastTip()->nTime < ASSETCHAINS_STAKED_HF_TIMESTAMP) - if ( !komodo_hardfork_active((uint32_t)chainActive.LastTip()->nTime) ) + if ( !hush_hardfork_active((uint32_t)chainActive.LastTip()->nTime) ) rawTx.nLockTime = (uint32_t)time(NULL) - 60; // jl777 else rawTx.nLockTime = (uint32_t)chainActive.Tip()->GetMedianTimePast(); @@ -600,7 +600,7 @@ bool AsyncRPCOperation_sendmany::main_impl() { crypto_sign_keypair(joinSplitPubKey_.begin(), joinSplitPrivKey_); mtx.joinSplitPubKey = joinSplitPubKey_; //if ((uint32_t)chainActive.LastTip()->nTime < ASSETCHAINS_STAKED_HF_TIMESTAMP) - if ( !komodo_hardfork_active((uint32_t)chainActive.LastTip()->nTime) ) + if ( !hush_hardfork_active((uint32_t)chainActive.LastTip()->nTime) ) mtx.nLockTime = (uint32_t)time(NULL) - 60; // jl777 else mtx.nLockTime = (uint32_t)chainActive.Tip()->GetMedianTimePast(); @@ -1376,7 +1376,7 @@ void AsyncRPCOperation_sendmany::add_taddr_outputs_to_tx() { rawTx.vout.push_back(out); } //if ((uint32_t)chainActive.LastTip()->nTime < ASSETCHAINS_STAKED_HF_TIMESTAMP) - if ( !komodo_hardfork_active((uint32_t)chainActive.LastTip()->nTime) ) + if ( !hush_hardfork_active((uint32_t)chainActive.LastTip()->nTime) ) rawTx.nLockTime = (uint32_t)time(NULL) - 60; // jl777 else rawTx.nLockTime = (uint32_t)chainActive.Tip()->GetMedianTimePast(); @@ -1407,7 +1407,7 @@ void AsyncRPCOperation_sendmany::add_taddr_change_output_to_tx(CBitcoinAddress * CMutableTransaction rawTx(tx_); rawTx.vout.push_back(out); //if ((uint32_t)chainActive.LastTip()->nTime < ASSETCHAINS_STAKED_HF_TIMESTAMP) - if ( !komodo_hardfork_active((uint32_t)chainActive.LastTip()->nTime) ) + if ( !hush_hardfork_active((uint32_t)chainActive.LastTip()->nTime) ) rawTx.nLockTime = (uint32_t)time(NULL) - 60; // jl777 else rawTx.nLockTime = (uint32_t)chainActive.Tip()->GetMedianTimePast(); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 2ae98fbe9..23a87da5b 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3654,7 +3654,7 @@ bool CWallet::CreateTransaction(const vector& vecSend, CWalletTx& wt CMutableTransaction txNew = CreateNewContextualCMutableTransaction(Params().GetConsensus(), nextBlockHeight); //if ((uint32_t)chainActive.LastTip()->nTime < ASSETCHAINS_STAKED_HF_TIMESTAMP) - if ( !komodo_hardfork_active((uint32_t)chainActive.LastTip()->nTime) ) + if ( !hush_hardfork_active((uint32_t)chainActive.LastTip()->nTime) ) txNew.nLockTime = (uint32_t)chainActive.LastTip()->nTime + 1; // set to a time close to now else txNew.nLockTime = (uint32_t)chainActive.Tip()->GetMedianTimePast();