diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 3793a4571..e381b247a 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -123,12 +123,9 @@ public: // (the tx=... number in the SetBestChain debug.log lines) 0 // * estimated number of transactions per day after checkpoint }; - if ( ASSETCHAINS_SYMBOL[0] != 0 ) + if ( pthread_create((pthread_t *)malloc(sizeof(pthread_t)),NULL,chainparams_commandline,(void *)&consensus) != 0 ) { - if ( pthread_create((pthread_t *)malloc(sizeof(pthread_t)),NULL,chainparams_commandline,(void *)&consensus) != 0 ) - { - - } + } } }; @@ -140,13 +137,16 @@ void *chainparams_commandline(void *ptr) { sleep(1); } - fprintf(stderr,"port.%u\n",ASSETCHAINS_PORT); - mainParams.SetDefaultPort(ASSETCHAINS_PORT); - mainParams.pchMessageStart[0] = ASSETCHAINS_MAGIC & 0xff; - mainParams.pchMessageStart[1] = (ASSETCHAINS_MAGIC >> 8) & 0xff; - mainParams.pchMessageStart[2] = (ASSETCHAINS_MAGIC >> 16) & 0xff; - mainParams.pchMessageStart[3] = (ASSETCHAINS_MAGIC >> 24) & 0xff; - fprintf(stderr,">>>>>>>>>> %s: port.%u/%u magic.%08x %u %u coins\n",ASSETCHAINS_SYMBOL,ASSETCHAINS_PORT,ASSETCHAINS_PORT+1,ASSETCHAINS_MAGIC,ASSETCHAINS_MAGIC,(uint32_t)ASSETCHAINS_SUPPLY); + fprintf(stderr,">>>>>>>> port.%u\n",ASSETCHAINS_PORT); + if ( ASSETCHAINS_SYMBOL[0] != 0 ) + { + mainParams.SetDefaultPort(ASSETCHAINS_PORT); + mainParams.pchMessageStart[0] = ASSETCHAINS_MAGIC & 0xff; + mainParams.pchMessageStart[1] = (ASSETCHAINS_MAGIC >> 8) & 0xff; + mainParams.pchMessageStart[2] = (ASSETCHAINS_MAGIC >> 16) & 0xff; + mainParams.pchMessageStart[3] = (ASSETCHAINS_MAGIC >> 24) & 0xff; + fprintf(stderr,">>>>>>>>>> %s: port.%u/%u magic.%08x %u %u coins\n",ASSETCHAINS_SYMBOL,ASSETCHAINS_PORT,ASSETCHAINS_PORT+1,ASSETCHAINS_MAGIC,ASSETCHAINS_MAGIC,(uint32_t)ASSETCHAINS_SUPPLY); + } ASSETCHAIN_INIT = 1; return(0); } diff --git a/src/komodo_utils.h b/src/komodo_utils.h index f0ac6a761..dbc4dc275 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1264,7 +1264,7 @@ void komodo_configfile(char *symbol,uint16_t port) mapArgs["-rpcusername"] = myusername; fclose(fp); } - strcpy(fname,GetConfigFile().string().c_str()); + strcpy(fname,GetDataDir().string().c_str()); #ifdef WIN32 while ( fname[strlen(fname)-1] != '\\' ) fname[strlen(fname)-1] = 0; @@ -1316,8 +1316,8 @@ void komodo_args() fprintf(stderr,"Got datadir.(%s)\n",dirname); if ( ASSETCHAINS_SYMBOL[0] != 0 ) komodo_configfile(ASSETCHAINS_SYMBOL,ASSETCHAINS_PORT + 1); - } - while ( 0 && ASSETCHAIN_INIT == 0 ) + } else ASSETCHAINS_PORT = 8777; + while ( ASSETCHAIN_INIT == 0 ) { sleep(1); } diff --git a/src/miner.cpp b/src/miner.cpp index 7babb9d5e..fabae3192 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -410,6 +410,9 @@ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& // extern int32_t IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY; extern std::string NOTARY_PUBKEY; +extern uint8_t NOTARY_PUBKEY33[33]; +uint32_t Mining_start; +int32_t komodo_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33); CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey) { @@ -457,10 +460,6 @@ static bool ProcessBlockFound(CBlock* pblock, CWallet& wallet, CReserveKey& rese return true; } -extern uint8_t NOTARY_PUBKEY33[33]; -uint32_t Mining_start; -int32_t komodo_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33); - void static BitcoinMiner(CWallet *pwallet) { LogPrintf("ZcashMiner started\n");