From 5e69ed0804074b961506c5e53bd3f0667be08bd8 Mon Sep 17 00:00:00 2001 From: Duke Date: Sun, 28 Jan 2024 09:52:24 -0500 Subject: [PATCH] Fix compile and const some stuff --- src/hush_utils.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hush_utils.h b/src/hush_utils.h index d1a037e3b..f9c93d16e 100644 --- a/src/hush_utils.h +++ b/src/hush_utils.h @@ -1473,7 +1473,7 @@ uint32_t hush_smartmagic(char *symbol,uint64_t supply,uint8_t *extraptr,int32_t } //TODO: why is this needed? - bool ishush3 = strncmp(symbol, "HUSH3",5) == 0 ? true : false; + const bool ishush3 = strncmp(symbol, "HUSH3",5) == 0 ? true : false; if(ishush3) { return HUSH_MAGIC; } else { @@ -1619,7 +1619,7 @@ uint64_t hush_sc_block_subsidy(int nHeight) int64_t subsidyDifference; int32_t numhalvings = 0, curEra = 0, sign = 1; static uint64_t cached_subsidy; static int32_t cached_numhalvings; static int cached_era; - bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false; + const bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false; // fprintf(stderr,"%s: ht=%d ishush3=%d\n", __func__, nHeight, ishush3); // check for backwards compat, older chains with no explicit rewards had 0.0001 block reward @@ -1797,6 +1797,8 @@ void hush_args(char *argv0) vector HUSH_nodes = {}; // Only HUSH3 and DRAGONX connect to these by default, other HACs must opt-in via -connect/-addnode + const bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false; + const bool isdragonx = strncmp(SMART_CHAIN_SYMBOL, "DRAGONX",7) == 0 ? true : false; if (ishush3 || isdragonx) { HUSH_nodes = {"node1.hush.is","node2.hush.is","node3.hush.is", "node4.hush.is","node5.hush.is","node6.hush.is", @@ -1888,7 +1890,6 @@ void hush_args(char *argv0) // Set our symbol from -ac_name value strncpy(SMART_CHAIN_SYMBOL,name.c_str(),sizeof(SMART_CHAIN_SYMBOL)-1); const bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false; - const bool isdragonx = strncmp(SMART_CHAIN_SYMBOL, "DRAGONX",7) == 0 ? true : false; ASSETCHAINS_LASTERA = GetArg("-ac_eras", 1); if(ishush3) {