From 874c3009cfa5865ee147b2962be4dda237699203 Mon Sep 17 00:00:00 2001 From: Duke Date: Sun, 28 Jan 2024 06:30:52 -0800 Subject: [PATCH] Only Hush + DragonX connect to these nodes by default #379 --- src/hush_utils.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/hush_utils.h b/src/hush_utils.h index de03f73ba..d1a037e3b 100644 --- a/src/hush_utils.h +++ b/src/hush_utils.h @@ -1795,15 +1795,24 @@ void hush_args(char *argv0) 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); - vector 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 HUSH_nodes = {}; + // Only HUSH3 and DRAGONX connect to these by default, other HACs must opt-in via -connect/-addnode + 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 more_nodes = mapMultiArgs["-addnode"]; if (more_nodes.size() > 0) { fprintf(stderr,"%s: Adding %lu more nodes via custom -addnode arguments\n", __func__, more_nodes.size() ); } - // Add default HUSH nodes after custom addnodes - more_nodes.insert( more_nodes.end(), HUSH_nodes.begin(), HUSH_nodes.end() ); + // Add default HUSH nodes after custom addnodes, if applicable + if(HUSH_nodes.size() > 0) { + more_nodes.insert( more_nodes.end(), HUSH_nodes.begin(), HUSH_nodes.end() ); + } mapMultiArgs["-addnode"] = more_nodes; HUSH_STOPAT = GetArg("-stopat",0); @@ -1878,7 +1887,8 @@ void hush_args(char *argv0) // Set our symbol from -ac_name value 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; + const bool isdragonx = strncmp(SMART_CHAIN_SYMBOL, "DRAGONX",7) == 0 ? true : false; ASSETCHAINS_LASTERA = GetArg("-ac_eras", 1); if(ishush3) {