transactionV5Timestamp moved to blockchain.json

This commit is contained in:
CalDescent 2022-01-30 13:47:20 +00:00
parent c5093168b1
commit c73cdefe6f
3 changed files with 9 additions and 3 deletions

View File

@ -68,7 +68,8 @@ public class BlockChain {
atFindNextTransactionFix,
newBlockSigHeight,
shareBinFix,
calcChainWeightTimestamp;
calcChainWeightTimestamp,
transactionV5Timestamp;
}
/** Map of which blockchain features are enabled when (height/timestamp) */
@ -391,6 +392,10 @@ public class BlockChain {
return this.featureTriggers.get(FeatureTrigger.calcChainWeightTimestamp.name()).longValue();
}
public long getTransactionV5Timestamp() {
return this.featureTriggers.get(FeatureTrigger.transactionV5Timestamp.name()).longValue();
}
// More complex getters for aspects that change by height or timestamp
public long getRewardAtHeight(int ourHeight) {

View File

@ -393,7 +393,7 @@ public abstract class Transaction {
* @return transaction version number
*/
public static int getVersionByTimestamp(long timestamp) {
if (timestamp >= 1642176000000L) {
if (timestamp >= BlockChain.getInstance().getTransactionV5Timestamp()) {
return 5;
}
return 4;

View File

@ -53,7 +53,8 @@
"atFindNextTransactionFix": 275000,
"newBlockSigHeight": 320000,
"shareBinFix": 399000,
"calcChainWeightTimestamp": 1620579600000
"calcChainWeightTimestamp": 1620579600000,
"transactionV5Timestamp": 1642176000000
},
"genesisInfo": {
"version": 4,