From 7daf6567294eff1f35c3b9e2f216075da760295f Mon Sep 17 00:00:00 2001 From: Michael Toutonghi Date: Sun, 15 Apr 2018 00:43:57 -0700 Subject: [PATCH] Rename time lock parameters and globals --- src/komodo_globals.h | 6 +++--- src/komodo_utils.h | 14 +++++++------- src/main.cpp | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/komodo_globals.h b/src/komodo_globals.h index 858385a37..c651a14de 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -58,9 +58,9 @@ uint64_t ASSETCHAINS_SUPPLY = 10; uint64_t ASSETCHAINS_COMMISSION; #define _ASSETCHAINS_TIMELOCKOFF 0x7fffffffffffffffLL -int64_t ASSETCHAINS_TIMELOCKABOVE = _ASSETCHAINS_TIMELOCKOFF; -uint64_t ASSETCHAINS_TIMELOCKFROM = 0; -uint64_t ASSETCHAINS_TIMELOCKTO = 0; +int64_t ASSETCHAINS_TIMELOCKGTE = _ASSETCHAINS_TIMELOCKOFF; +uint64_t ASSETCHAINS_TIMEUNLOCKFROM = 0; +uint64_t ASSETCHAINS_TIMEUNLOCKTO = 0; uint32_t ASSETCHAINS_ERAS = 1; uint64_t ASSETCHAINS_ENDSUBSIDY[ASSETCHAINS_MAX_ERAS],ASSETCHAINS_REWARD[ASSETCHAINS_MAX_ERAS],ASSETCHAINS_HALVING[ASSETCHAINS_MAX_ERAS],ASSETCHAINS_DECAY[ASSETCHAINS_MAX_ERAS]; diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 40e14cd54..e86df91d6 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1758,9 +1758,9 @@ void komodo_args(char *argv0) } ASSETCHAINS_ERAS -= 1; - ASSETCHAINS_TIMELOCKABOVE = GetArg("-ac_timelockabove", _ASSETCHAINS_TIMELOCKOFF); - ASSETCHAINS_TIMELOCKFROM = GetArg("-ac_timelockfrom", 0); - ASSETCHAINS_TIMELOCKTO = GetArg("-ac_timelockto", 0); + ASSETCHAINS_TIMELOCKGTE = GetArg("-ac_timelockgte", _ASSETCHAINS_TIMELOCKOFF); + ASSETCHAINS_TIMEUNLOCKFROM = GetArg("-ac_timeunlockfrom", 0); + ASSETCHAINS_TIMEUNLOCKTO = GetArg("-ac_timeunlockto", 0); Split(GetArg("-ac_end",""), ASSETCHAINS_ENDSUBSIDY, 0); Split(GetArg("-ac_reward",""), ASSETCHAINS_REWARD, 0); @@ -1823,11 +1823,11 @@ void komodo_args(char *argv0) // hash in lock above for time locked coinbase transactions above a certain reward value only if the lock above // param was specified, otherwise, for compatibility, do nothing - if ( ASSETCHAINS_TIMELOCKABOVE != _ASSETCHAINS_TIMELOCKOFF ) + if ( ASSETCHAINS_TIMELOCKGTE != _ASSETCHAINS_TIMELOCKOFF ) { - extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_TIMELOCKABOVE),(void *)&ASSETCHAINS_TIMELOCKABOVE); - extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_TIMELOCKFROM),(void *)&ASSETCHAINS_TIMELOCKFROM); - extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_TIMELOCKTO),(void *)&ASSETCHAINS_TIMELOCKTO); + extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_TIMELOCKGTE),(void *)&ASSETCHAINS_TIMELOCKGTE); + extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_TIMEUNLOCKFROM),(void *)&ASSETCHAINS_TIMEUNLOCKFROM); + extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_TIMEUNLOCKTO),(void *)&ASSETCHAINS_TIMEUNLOCKTO); } extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_COMMISSION),(void *)&ASSETCHAINS_COMMISSION); diff --git a/src/main.cpp b/src/main.cpp index f0edc8ef0..a779bc89d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -964,7 +964,7 @@ bool ContextualCheckTransaction(const CTransaction& tx, CValidationState &state, } } - if (tx.IsCoinBase() && tx.vout[0].nValue >= ASSETCHAINS_TIMELOCKABOVE) + if (tx.IsCoinBase() && tx.vout[0].nValue >= ASSETCHAINS_TIMELOCKGTE) { // if time locks are on, ensure that this coin base is time locked exactly as it should be