diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index c3bdf6474..d2df1792c 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -23,7 +23,7 @@ Tell us what should happen Tell us what happens instead including any noticable error output (any messages displayed on-screen when e.g. a crash occurred) -### The version of Komodo you were using: +### The version of Hush you were using: Run `hushd --version` to find out @@ -41,5 +41,4 @@ Run `hushd --version` to find out This includes the relevant contents of `~/.komodo/HUSH3/debug.log`. You can paste raw text, attach the file directly in the issue or link to the text via a pastebin type site. Please also include any non-standard things you did during compilation (extra flags, dependency version changes etc.) if applicable. -Beware that usernames and IP addresses and other metadata may be in this log file. - +Beware that usernames and IP addresses and other metadata is definitely in this log file! diff --git a/src/cc/CCPrices.h b/src/cc/CCPrices.h index 97fd7e50e..bb3a4563d 100644 --- a/src/cc/CCPrices.h +++ b/src/cc/CCPrices.h @@ -24,7 +24,7 @@ #include "CCinclude.h" int32_t komodo_priceget(int64_t *buf64,int32_t ind,int32_t height,int32_t numblocks); -extern void GetKomodoEarlytxidScriptPub(); +extern void GetHushEarlytxidScriptPub(); extern CScript HUSH_EARLYTXID_SCRIPTPUB; // #define PRICES_DAYWINDOW ((3600*24/ASSETCHAINS_BLOCKTIME) + 1) // defined in hush_defs.h diff --git a/src/cc/prices.cpp b/src/cc/prices.cpp index c182419e1..6a9779050 100644 --- a/src/cc/prices.cpp +++ b/src/cc/prices.cpp @@ -65,7 +65,7 @@ mine the chain past block 100, preventing anyone else, creating another payments We call the following in Validation and RPC where the address is needed. if ( ASSETCHAINS_EARLYTXIDCONTRACT == EVAL_PRICES && HUSH_EARLYTXID_SCRIPTPUB.size() == 0 ) - GetKomodoEarlytxidScriptPub(); + GetHushEarlytxidScriptPub(); This will fetch the op_return, calculate the scriptPubKey and save it to the global. On daemon restart as soon as validation for BETTX happens the global will be filled, after this the transaction never needs to be looked up again. @@ -245,7 +245,7 @@ static bool ValidateBetTx(struct CCcontract_info *cp, Eval *eval, const CTransac // check payment cc config: if ( ASSETCHAINS_EARLYTXIDCONTRACT == EVAL_PRICES && HUSH_EARLYTXID_SCRIPTPUB.size() == 0 ) - GetKomodoEarlytxidScriptPub(); + GetHushEarlytxidScriptPub(); if (bettx.vout.size() < 6 || bettx.vout.size() > 7) return eval->Invalid("incorrect vout number for bet tx"); @@ -298,7 +298,7 @@ static bool ValidateAddFundingTx(struct CCcontract_info *cp, Eval *eval, const C // check payment cc config: if (ASSETCHAINS_EARLYTXIDCONTRACT == EVAL_PRICES && HUSH_EARLYTXID_SCRIPTPUB.size() == 0) - GetKomodoEarlytxidScriptPub(); + GetHushEarlytxidScriptPub(); if (addfundingtx.vout.size() < 4 || addfundingtx.vout.size() > 5) return eval->Invalid("incorrect vout number for add funding tx"); @@ -1510,7 +1510,7 @@ UniValue PricesBet(int64_t txfee, int64_t amount, int16_t leverage, std::vector< // Lock here, as in validation we cannot call lock in the function itself. // may not be needed as the validation call to update the global, is called in a LOCK already, and it can only update there and here. LOCK(cs_main); - GetKomodoEarlytxidScriptPub(); + GetHushEarlytxidScriptPub(); } mtx.vout.push_back(CTxOut(amount-betamount, HUSH_EARLYTXID_SCRIPTPUB)); //test: mtx.vout.push_back(CTxOut(amount - betamount, CScript() << ParseHex("037c803ec82d12da939ac04379bbc1130a9065c53d8244a61eece1db942cf0efa7") << OP_CHECKSIG)); // vout4 test revshare fee @@ -1581,7 +1581,7 @@ UniValue PricesAddFunding(int64_t txfee, uint256 bettxid, int64_t amount) // Lock here, as in validation we cannot call lock in the function itself. // may not be needed as the validation call to update the global, is called in a LOCK already, and it can only update there and here. LOCK(cs_main); - GetKomodoEarlytxidScriptPub(); + GetHushEarlytxidScriptPub(); } mtx.vout.push_back(CTxOut(amount - betamount, HUSH_EARLYTXID_SCRIPTPUB)); // test: mtx.vout.push_back(CTxOut(amount - betamount, CScript() << ParseHex("037c803ec82d12da939ac04379bbc1130a9065c53d8244a61eece1db942cf0efa7") << OP_CHECKSIG)); //vout2 test revshare fee diff --git a/src/hush_bitcoind.h b/src/hush_bitcoind.h index fc0075d3a..375942951 100644 --- a/src/hush_bitcoind.h +++ b/src/hush_bitcoind.h @@ -1803,7 +1803,7 @@ bool komodo_appendACscriptpub() return false; } -void GetKomodoEarlytxidScriptPub() +void GetHushEarlytxidScriptPub() { if ( HUSH_EARLYTXID == zeroid ) { diff --git a/src/hush_defs.h b/src/hush_defs.h index 7ad109699..3c5191ea8 100644 --- a/src/hush_defs.h +++ b/src/hush_defs.h @@ -481,7 +481,7 @@ static const char *notaries_elected[NUM_HUSH_SEASONS][NUM_HUSH_NOTARIES][2] = #define HUSH_MAXNVALUE (((uint64_t)1 << 63) - 1) #define KOMODO_BIT63SET(x) ((x) & ((uint64_t)1 << 63)) -#define KOMODO_VALUETOOBIG(x) ((x) > (uint64_t)10000000001*COIN) +#define HUSH_VALUETOOBIG(x) ((x) > (uint64_t)10000000001*COIN) //#ifndef TESTMODE #define PRICES_DAYWINDOW ((3600*24/ASSETCHAINS_BLOCKTIME) + 1) diff --git a/src/hush_events.h b/src/hush_events.h index 8ecbf0a64..31655109a 100644 --- a/src/hush_events.h +++ b/src/hush_events.h @@ -33,8 +33,8 @@ struct hush_event *hush_eventadd(struct hush_state *sp,int32_t height,char *symb strcpy(ep->symbol,symbol); if ( datalen != 0 ) memcpy(ep->space,data,datalen); - sp->Hush_events = (struct hush_event **)realloc(sp->Hush_events,(1 + sp->Komodo_numevents) * sizeof(*sp->Hush_events)); - sp->Hush_events[sp->Komodo_numevents++] = ep; + sp->Hush_events = (struct hush_event **)realloc(sp->Hush_events,(1 + sp->Hush_numeventss) * sizeof(*sp->Hush_events)); + sp->Hush_events[sp->Hush_numeventss++] = ep; portable_mutex_unlock(&komodo_mutex); } return(ep); @@ -141,15 +141,15 @@ void hush_event_rewind(struct hush_state *sp,char *symbol,int32_t height) KOMODO_LASTMINED = prevKOMODO_LASTMINED; prevKOMODO_LASTMINED = 0; } - while ( sp->Hush_events != 0 && sp->Komodo_numevents > 0 ) + while ( sp->Hush_events != 0 && sp->Hush_numeventss > 0 ) { - if ( (ep= sp->Hush_events[sp->Komodo_numevents-1]) != 0 ) + if ( (ep= sp->Hush_events[sp->Hush_numeventss-1]) != 0 ) { if ( ep->height < height ) break; //printf("[%s] undo %s event.%c ht.%d for rewind.%d\n",SMART_CHAIN_SYMBOL,symbol,ep->type,ep->height,height); hush_event_undo(sp,ep); - sp->Komodo_numevents--; + sp->Hush_numeventss--; } } } diff --git a/src/hush_globals.h b/src/hush_globals.h index 4377c9ac4..c4f95ca68 100644 --- a/src/hush_globals.h +++ b/src/hush_globals.h @@ -40,7 +40,7 @@ pthread_mutex_t komodo_mutex,staked_mutex; struct pax_transaction *PAX; int32_t NUM_PRICES; uint32_t *PVALS; struct knotaries_entry *Pubkeys; -struct hush_state KOMODO_STATES[34]; +struct hush_state HUSH_STATES[34]; #define _COINBASE_MATURITY 100 int COINBASE_MATURITY = _COINBASE_MATURITY;//100; @@ -48,7 +48,7 @@ unsigned int WITNESS_CACHE_SIZE = _COINBASE_MATURITY+10; uint256 HUSH_EARLYTXID; int32_t HUSH_MININGTHREADS = -1,IS_HUSH_NOTARY,USE_EXTERNAL_PUBKEY,HUSH_CHOSEN_ONE,ASSETCHAINS_SEED,KOMODO_ON_DEMAND,HUSH_EXTERNAL_NOTARIES,HUSH_PASSPORT_INITDONE,KOMODO_PAX,HUSH_EXCHANGEWALLET,HUSH_REWIND,HUSH_CONNECTING = -1,KOMODO_DEALERNODE,HUSH_EXTRASATOSHI,ASSETCHAINS_FOUNDERS,ASSETCHAINS_CBMATURITY,HUSH_NSPV; -int32_t HUSH_INSYNC,KOMODO_LASTMINED,prevKOMODO_LASTMINED,HUSH_CCACTIVATE,JUMBLR_PAUSE = 1; +int32_t HUSH_INSYNC,KOMODO_LASTMINED,prevKOMODO_LASTMINED,HUSH_CCACTIVATE; std::string NOTARY_PUBKEY,ASSETCHAINS_NOTARIES,ASSETCHAINS_OVERRIDE_PUBKEY,DONATION_PUBKEY,ASSETCHAINS_SCRIPTPUB,NOTARY_ADDRESS,ASSETCHAINS_SELFIMPORT,ASSETCHAINS_CCLIB; uint8_t NOTARY_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEYHASH[20],ASSETCHAINS_PUBLIC,ASSETCHAINS_PRIVATE,ASSETCHAINS_TXPOW,ASSETCHAINS_MARMARA; int8_t ASSETCHAINS_ADAPTIVEPOW; diff --git a/src/hush_structs.h b/src/hush_structs.h index 866b960f2..64a7689f3 100644 --- a/src/hush_structs.h +++ b/src/hush_structs.h @@ -122,7 +122,7 @@ struct hush_state uint32_t SAVEDTIMESTAMP; uint64_t deposited,issued,withdrawn,approved,redeemed,shorted; struct notarized_checkpoint *NPOINTS; int32_t NUM_NPOINTS,last_NPOINTSi; - struct hush_event **Hush_events; int32_t Komodo_numevents; + struct hush_event **Hush_events; int32_t Hush_numeventss; uint32_t RTbufs[64][3]; uint64_t RTmask; }; diff --git a/src/hush_utils.h b/src/hush_utils.h index 39a8e6a88..edc55a47c 100644 --- a/src/hush_utils.h +++ b/src/hush_utils.h @@ -2467,10 +2467,10 @@ struct hush_state *hush_stateptrget(char *base) { int32_t baseid; if ( base == 0 || base[0] == 0 || strcmp(base,(char *)"KYCSELLOUTS") == 0 ) - return(&KOMODO_STATES[33]); + return(&HUSH_STATES[33]); else if ( (baseid= komodo_baseid(base)) >= 0 ) - return(&KOMODO_STATES[baseid+1]); - else return(&KOMODO_STATES[0]); + return(&HUSH_STATES[baseid+1]); + else return(&HUSH_STATES[0]); } struct hush_state *hush_stateptr(char *symbol,char *dest) diff --git a/src/main.cpp b/src/main.cpp index 085cec395..bb480990e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1817,7 +1817,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa CAmount nValueOut = tx.GetValueOut(); CAmount nFees = nValueIn-nValueOut; double dPriority = view.GetPriority(tx, chainActive.Height()); - if ( nValueOut > 777777*COIN && KOMODO_VALUETOOBIG(nValueOut - 777777*COIN) != 0 ) // some room for blockreward and txfees + if ( nValueOut > 777777*COIN && HUSH_VALUETOOBIG(nValueOut - 777777*COIN) != 0 ) // some room for blockreward and txfees return state.DoS(100, error("AcceptToMemoryPool: GetValueOut too big"),REJECT_INVALID,"tx valueout is too big"); // Keep track of transactions that spend a coinbase, which we re-scan @@ -3380,14 +3380,14 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin txdata.emplace_back(tx); valueout = tx.GetValueOut(); - if ( KOMODO_VALUETOOBIG(valueout) != 0 ) + if ( HUSH_VALUETOOBIG(valueout) != 0 ) { fprintf(stderr,"valueout %.8f too big\n",(double)valueout/COIN); return state.DoS(100, error("ConnectBlock(): GetValueOut too big"),REJECT_INVALID,"tx valueout is too big"); } //prevsum = voutsum; //voutsum += valueout; - /*if ( KOMODO_VALUETOOBIG(voutsum) != 0 ) + /*if ( HUSH_VALUETOOBIG(voutsum) != 0 ) { fprintf(stderr,"voutsum %.8f too big\n",(double)voutsum/COIN); return state.DoS(100, error("ConnectBlock(): voutsum too big"),REJECT_INVALID,"tx valueout is too big"); diff --git a/src/miner.cpp b/src/miner.cpp index 658db53ad..80ec249d8 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -174,7 +174,7 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 //fprintf(stderr,"create new block\n"); // Create new block if ( gpucount < 0 ) - gpucount = KOMODO_MAXGPUCOUNT; + gpucount = HUSH_MAXGPUCOUNT; std::unique_ptr pblocktemplate(new CBlockTemplate()); if(!pblocktemplate.get()) { @@ -286,7 +286,7 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 continue; } txvalue = tx.GetValueOut(); - if ( KOMODO_VALUETOOBIG(txvalue) != 0 ) + if ( HUSH_VALUETOOBIG(txvalue) != 0 ) continue; COrphan* porphan = NULL; @@ -1072,7 +1072,7 @@ void static BitcoinMiner() unsigned int n = chainparams.EquihashN(); unsigned int k = chainparams.EquihashK(); - uint8_t *script; uint64_t total; int32_t i,j,gpucount=KOMODO_MAXGPUCOUNT,notaryid = -1; + uint8_t *script; uint64_t total; int32_t i,j,gpucount=HUSH_MAXGPUCOUNT,notaryid = -1; while ( (ASSETCHAIN_INIT == 0 || HUSH_INITDONE == 0) ) { sleep(1); diff --git a/src/miner.h b/src/miner.h index 6e7b587b7..5fc515dab 100644 --- a/src/miner.h +++ b/src/miner.h @@ -39,7 +39,7 @@ struct CBlockTemplate std::vector vTxFees; std::vector vTxSigOps; }; -#define KOMODO_MAXGPUCOUNT 65 +#define HUSH_MAXGPUCOUNT 65 /** Generate a new block, without valid proof-of-work */ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& scriptPubKeyIn, int32_t gpucount, bool isStake = false); diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 5e9120491..d7417f960 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -255,7 +255,7 @@ UniValue generate(const UniValue& params, bool fHelp, const CPubKey& mypk) lastTime = GetTime(); #ifdef ENABLE_WALLET - std::unique_ptr pblocktemplate(CreateNewBlockWithKey(reservekey,nHeight,KOMODO_MAXGPUCOUNT)); + std::unique_ptr pblocktemplate(CreateNewBlockWithKey(reservekey,nHeight,HUSH_MAXGPUCOUNT)); #else std::unique_ptr pblocktemplate(CreateNewBlockWithKey()); #endif @@ -753,7 +753,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp, const CPubKey& myp #ifdef ENABLE_WALLET CReserveKey reservekey(pwalletMain); LEAVE_CRITICAL_SECTION(cs_main); - pblocktemplate = CreateNewBlockWithKey(reservekey,pindexPrevNew->GetHeight()+1,KOMODO_MAXGPUCOUNT,false); + pblocktemplate = CreateNewBlockWithKey(reservekey,pindexPrevNew->GetHeight()+1,HUSH_MAXGPUCOUNT,false); #else pblocktemplate = CreateNewBlockWithKey(); #endif diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 33cafad4d..0d6ad53e1 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -62,7 +62,7 @@ int32_t hush_notarized_height(int32_t *prevMoMheightp,uint256 *hashp,uint256 *tx bool komodo_txnotarizedconfirmed(uint256 txid); uint32_t hush_chainactive_timestamp(); int32_t hush_whoami(char *pubkeystr,int32_t height,uint32_t timestamp); -extern int32_t KOMODO_LASTMINED,JUMBLR_PAUSE,HUSH_LONGESTCHAIN,IS_HUSH_NOTARY,HUSH_INSYNC; +extern int32_t KOMODO_LASTMINED,HUSH_LONGESTCHAIN,IS_HUSH_NOTARY,HUSH_INSYNC; extern char SMART_CHAIN_SYMBOL[HUSH_SMART_CHAIN_MAXLEN]; uint32_t komodo_segid32(char *coinaddr); int64_t hush_coinsupply(int64_t *zfundsp,int64_t *sproutfundsp,int32_t height);