Compare commits

...

2 Commits

Author SHA1 Message Date
Duke
5e69ed0804 Fix compile and const some stuff 2024-01-28 09:52:24 -05:00
Duke
874c3009cf Only Hush + DragonX connect to these nodes by default #379 2024-01-28 06:30:52 -08:00

View File

@ -1473,7 +1473,7 @@ uint32_t hush_smartmagic(char *symbol,uint64_t supply,uint8_t *extraptr,int32_t
} }
//TODO: why is this needed? //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) { if(ishush3) {
return HUSH_MAGIC; return HUSH_MAGIC;
} else { } else {
@ -1619,7 +1619,7 @@ uint64_t hush_sc_block_subsidy(int nHeight)
int64_t subsidyDifference; int64_t subsidyDifference;
int32_t numhalvings = 0, curEra = 0, sign = 1; int32_t numhalvings = 0, curEra = 0, sign = 1;
static uint64_t cached_subsidy; static int32_t cached_numhalvings; static int cached_era; 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); // 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 // check for backwards compat, older chains with no explicit rewards had 0.0001 block reward
@ -1795,15 +1795,26 @@ void hush_args(char *argv0)
name = GetArg("-ac_name","HUSH3"); name = GetArg("-ac_name","HUSH3");
fprintf(stderr,".oO Starting %s Full Node (Extreme Privacy!) with genproc=%d notary=%d\n",name.c_str(),HUSH_MININGTHREADS, IS_HUSH_NOTARY); fprintf(stderr,".oO Starting %s Full Node (Extreme Privacy!) with genproc=%d notary=%d\n",name.c_str(),HUSH_MININGTHREADS, IS_HUSH_NOTARY);
vector<string> HUSH_nodes= {"node1.hush.is","node2.hush.is","node3.hush.is", vector<string> HUSH_nodes = {};
"node4.hush.is","node5.hush.is","node6.hush.is", // Only HUSH3 and DRAGONX connect to these by default, other HACs must opt-in via -connect/-addnode
"node7.hush.is","node8.hush.is","node1.hush.land", "node2.hush.land", "node3.hush.land", "node4.hush.land", "node5.hush.land"}; 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",
"node7.hush.is","node8.hush.is","node1.hush.land",
"node2.hush.land", "node3.hush.land",
"node4.hush.land", "node5.hush.land"};
}
vector<string> more_nodes = mapMultiArgs["-addnode"]; vector<string> more_nodes = mapMultiArgs["-addnode"];
if (more_nodes.size() > 0) { if (more_nodes.size() > 0) {
fprintf(stderr,"%s: Adding %lu more nodes via custom -addnode arguments\n", __func__, more_nodes.size() ); fprintf(stderr,"%s: Adding %lu more nodes via custom -addnode arguments\n", __func__, more_nodes.size() );
} }
// Add default HUSH nodes after custom addnodes // Add default HUSH nodes after custom addnodes, if applicable
more_nodes.insert( more_nodes.end(), HUSH_nodes.begin(), HUSH_nodes.end() ); if(HUSH_nodes.size() > 0) {
more_nodes.insert( more_nodes.end(), HUSH_nodes.begin(), HUSH_nodes.end() );
}
mapMultiArgs["-addnode"] = more_nodes; mapMultiArgs["-addnode"] = more_nodes;
HUSH_STOPAT = GetArg("-stopat",0); HUSH_STOPAT = GetArg("-stopat",0);
@ -1878,7 +1889,7 @@ void hush_args(char *argv0)
// Set our symbol from -ac_name value // Set our symbol from -ac_name value
strncpy(SMART_CHAIN_SYMBOL,name.c_str(),sizeof(SMART_CHAIN_SYMBOL)-1); strncpy(SMART_CHAIN_SYMBOL,name.c_str(),sizeof(SMART_CHAIN_SYMBOL)-1);
bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false; const bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false;
ASSETCHAINS_LASTERA = GetArg("-ac_eras", 1); ASSETCHAINS_LASTERA = GetArg("-ac_eras", 1);
if(ishush3) { if(ishush3) {