It is called hush_hardfork_active now

This commit is contained in:
Duke Leto
2019-12-13 11:08:10 -05:00
parent b6e93662c7
commit e8509dd525
7 changed files with 17 additions and 15 deletions

View File

@@ -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
{

View File

@@ -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);

View File

@@ -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);

View File

@@ -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();

View File

@@ -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))

View File

@@ -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();

View File

@@ -3654,7 +3654,7 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& 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();