This commit is contained in:
Duke Leto
2020-12-09 19:20:26 -05:00
parent 18ce9a6070
commit 86bd499818
4 changed files with 14 additions and 29 deletions

View File

@@ -548,17 +548,17 @@ void hush_changeblocktime()
void hush_setactivation(int32_t height) void hush_setactivation(int32_t height)
{ {
pCurrentParams->consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight = height; pCurrentParams->consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight = height;
pCurrentParams->consensus.vUpgrades[Consensus::UPGRADE_OVERWINTER].nActivationHeight = height; pCurrentParams->consensus.vUpgrades[Consensus::UPGRADE_OVERWINTER].nActivationHeight = height;
ASSETCHAINS_SAPLING = height; ASSETCHAINS_SAPLING = height;
fprintf(stderr,"SET SAPLING ACTIVATION height.%d\n",height); fprintf(stderr,"SET SAPLING ACTIVATION height.%d\n",height);
} }
void *chainparams_commandline() void *chainparams_commandline() {
{
fprintf(stderr,"chainparams_commandline called\n");
CChainParams::CCheckpointData checkpointData; CChainParams::CCheckpointData checkpointData;
//fprintf(stderr,">>>>>>>> port.%u\n",ASSETCHAINS_P2PPORT); if(fDebug) {
fprintf(stderr,"chainparams_commandline called with port=%u\n", ASSETCHAINS_P2PPORT);
}
if ( SMART_CHAIN_SYMBOL[0] != 0 ) if ( SMART_CHAIN_SYMBOL[0] != 0 )
{ {
if ( ASSETCHAINS_BLOCKTIME != 60 ) if ( ASSETCHAINS_BLOCKTIME != 60 )

View File

@@ -127,11 +127,7 @@ static const char* DEFAULT_ASMAP_FILENAME="ip_asn.map";
CClientUIInterface uiInterface; // Declared but not defined in ui_interface.h CClientUIInterface uiInterface; // Declared but not defined in ui_interface.h
//////////////////////////////////////////////////////////////////////////////
//
// Shutdown // Shutdown
//
// //
// Thread management and startup/shutdown: // Thread management and startup/shutdown:
// //
@@ -151,7 +147,6 @@ CClientUIInterface uiInterface; // Declared but not defined in ui_interface.h
// Note that if running -daemon the parent process returns from AppInit2 // Note that if running -daemon the parent process returns from AppInit2
// before adding any threads to the threadGroup, so .join_all() returns // before adding any threads to the threadGroup, so .join_all() returns
// immediately and the parent exits from main(). // immediately and the parent exits from main().
//
std::atomic<bool> fRequestShutdown(false); std::atomic<bool> fRequestShutdown(false);
@@ -201,7 +196,8 @@ void Interrupt(boost::thread_group& threadGroup)
void Shutdown() void Shutdown()
{ {
fprintf(stderr,"%s: start\n", __FUNCTION__); if(fDebug)
fprintf(stderr,"%s: start\n", __FUNCTION__);
LogPrintf("%s: In progress...\n", __func__); LogPrintf("%s: In progress...\n", __func__);
static CCriticalSection cs_Shutdown; static CCriticalSection cs_Shutdown;
TRY_LOCK(cs_Shutdown, lockShutdown); TRY_LOCK(cs_Shutdown, lockShutdown);
@@ -217,7 +213,7 @@ void Shutdown()
RenameThread(shutoffstr); RenameThread(shutoffstr);
mempool.AddTransactionsUpdated(1); mempool.AddTransactionsUpdated(1);
fprintf(stderr,"%s: stopping HTTP/REST/RPC\n", __FUNCTION__); fprintf(stderr,"%s: stopping HUSH HTTP/REST/RPC\n", __FUNCTION__);
StopHTTPRPC(); StopHTTPRPC();
StopREST(); StopREST();
StopRPC(); StopRPC();
@@ -288,17 +284,13 @@ void Shutdown()
delete pwalletMain; delete pwalletMain;
pwalletMain = NULL; pwalletMain = NULL;
#endif #endif
//delete pzcashParams;
//pzcashParams = NULL;
globalVerifyHandle.reset(); globalVerifyHandle.reset();
ECC_Stop(); ECC_Stop();
CNode::NetCleanup(); CNode::NetCleanup();
LogPrintf("%s: done\n", __func__); LogPrintf("%s: done\n", __func__);
} }
/** // Signal handlers are very limited in what they are allowed to do, so:
* Signal handlers are very limited in what they are allowed to do, so:
*/
void HandleSIGTERM(int) void HandleSIGTERM(int)
{ {
fprintf(stderr,"%s\n",__FUNCTION__); fprintf(stderr,"%s\n",__FUNCTION__);
@@ -359,7 +351,6 @@ std::string HelpMessage(HelpMessageMode mode)
string strUsage = HelpMessageGroup(_("Options:")); string strUsage = HelpMessageGroup(_("Options:"));
strUsage += HelpMessageOpt("-?", _("This help message")); strUsage += HelpMessageOpt("-?", _("This help message"));
strUsage += HelpMessageOpt("-alerts", strprintf(_("Receive and display P2P network alerts (default: %u)"), DEFAULT_ALERTS));
strUsage += HelpMessageOpt("-alertnotify=<cmd>", _("Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)")); strUsage += HelpMessageOpt("-alertnotify=<cmd>", _("Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)"));
strUsage += HelpMessageOpt("-blocknotify=<cmd>", _("Execute command when the best block changes (%s in cmd is replaced by block hash)")); strUsage += HelpMessageOpt("-blocknotify=<cmd>", _("Execute command when the best block changes (%s in cmd is replaced by block hash)"));
strUsage += HelpMessageOpt("-checkblocks=<n>", strprintf(_("How many blocks to check at startup (default: %u, 0 = all)"), 288)); strUsage += HelpMessageOpt("-checkblocks=<n>", strprintf(_("How many blocks to check at startup (default: %u, 0 = all)"), 288));
@@ -1028,9 +1019,6 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
if (mapArgs.count("-developerencryptwallet")) { if (mapArgs.count("-developerencryptwallet")) {
fprintf(stderr,"%s wallet encryption error\n", __FUNCTION__); fprintf(stderr,"%s wallet encryption error\n", __FUNCTION__);
return InitError(_("Wallet encryption requires -experimentalfeatures.")); return InitError(_("Wallet encryption requires -experimentalfeatures."));
} else if (mapArgs.count("-zmergetoaddress")) {
//fprintf(stderr,"%s zmerge error\n", __FUNCTION__);
//return InitError(_("RPC method z_mergetoaddress requires -experimentalfeatures."));
} }
} }
//fprintf(stderr,"%s tik2\n", __FUNCTION__); //fprintf(stderr,"%s tik2\n", __FUNCTION__);
@@ -2024,9 +2012,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
{ {
pwalletMain->ClearNoteWitnessCache(); pwalletMain->ClearNoteWitnessCache();
pindexRescan = chainActive.Genesis(); pindexRescan = chainActive.Genesis();
} } else {
else
{
CWalletDB walletdb(strWalletFile); CWalletDB walletdb(strWalletFile);
CBlockLocator locator; CBlockLocator locator;
if (walletdb.ReadBestBlock(locator)) if (walletdb.ReadBestBlock(locator))

View File

@@ -499,7 +499,8 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
nbits = bnTarget.GetCompact(); nbits = bnTarget.GetCompact();
nbits = (nbits & 0xfffffffc) | zawyflag; nbits = (nbits & 0xfffffffc) | zawyflag;
} }
fprintf(stderr,"%s: nbits=%d\n", __func__, nbits); if(fDebug)
fprintf(stderr,"%s: nbits=%d\n", __func__, nbits);
return(nbits); return(nbits);
} }
@@ -542,6 +543,8 @@ unsigned int CalculateNextWorkRequired(arith_uint256 bnAvg,
LogPrint("pow", "Current average: %08x %s\n", bnAvg.GetCompact(), bnAvg.ToString()); LogPrint("pow", "Current average: %08x %s\n", bnAvg.GetCompact(), bnAvg.ToString());
LogPrint("pow", "After: %08x %s\n", bnNew.GetCompact(), bnNew.ToString()); LogPrint("pow", "After: %08x %s\n", bnNew.GetCompact(), bnNew.ToString());
if(fDebug)
fprintf(stderr,"%s: nbits=%u\n",__func__,nbits);
return bnNew.GetCompact(); return bnNew.GetCompact();
} }

View File

@@ -17,9 +17,7 @@
* Removal or modification of this copyright notice is prohibited. * * Removal or modification of this copyright notice is prohibited. *
* * * *
******************************************************************************/ ******************************************************************************/
#include "rpc/server.h" #include "rpc/server.h"
#include "clientversion.h" #include "clientversion.h"
#include "main.h" #include "main.h"
#include "net.h" #include "net.h"
@@ -31,9 +29,7 @@
#include "version.h" #include "version.h"
#include "deprecation.h" #include "deprecation.h"
#include "hush/utiltls.h" #include "hush/utiltls.h"
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <univalue.h> #include <univalue.h>
using namespace std; using namespace std;