diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index dc85547a9..68e0da8b3 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -70,8 +70,8 @@ void WaitForShutdown(boost::thread_group* threadGroup) { int32_t i; bool fShutdown = ShutdownRequested(); // Tell the main threads to shutdown. - //if ( ASSETCHAINS_CBOPRET != 0 ) - // komodo_pricesinit(); + if ( ASSETCHAINS_CBOPRET != 0 ) + komodo_pricesinit(); while (!fShutdown) { //fprintf(stderr,"call passport iteration\n"); diff --git a/src/komodo_defs.h b/src/komodo_defs.h index a78276fb3..4fd357ac1 100644 --- a/src/komodo_defs.h +++ b/src/komodo_defs.h @@ -87,6 +87,6 @@ void komodo_netevent(std::vector payload); #define PRICES_SMOOTHWIDTH 1 int32_t komodo_priceind(char *symbol); -void komodo_pricesinit(); +int32_t komodo_pricesinit(); #endif diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 3a3dba00e..cebe152ff 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -2658,12 +2658,12 @@ int64_t komodo_priceave(int64_t *buf,int64_t *correlated,int32_t cskip) return((price*7 + halfave*5 + thirdave*3 + fourthave*2 + decayprice + buf[PRICES_DAYWINDOW-1]) / 19); } -void komodo_pricesinit() +int32_t komodo_pricesinit() { static int32_t didinit; int32_t i,createflag = 0; if ( didinit != 0 ) - return; + return(-1); didinit = 1; boost::filesystem::path pricefname,pricesdir = GetDataDir() / "prices"; fprintf(stderr,"pricesinit (%s)\n",pricesdir.string().c_str()); @@ -2690,6 +2690,8 @@ void komodo_pricesinit() fputc(0,PRICES[0].fp); fflush(PRICES[0].fp); } + fprintf(stderr,"pricesinit done\n"); + return(0); } void komodo_pricesupdate(int32_t height,CBlock *pblock) diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 363eb73ce..a3d611f9f 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -2100,7 +2100,7 @@ void komodo_args(char *argv0) extralen += symbol.size(); } } - komodo_pricesinit(); + //komodo_pricesinit(); komodo_cbopretupdate(1); // will set Mineropret fprintf(stderr,"This blockchain uses data produced from CoinDesk Bitcoin Price Index\n"); }