Browse Source

test

etomic
jl777 7 years ago
parent
commit
fff8900cdb
  1. 12
      crypto777/bitcoind_RPC.c
  2. 2
      iguana/exchanges/LP_coins.c
  3. 5
      iguana/exchanges/LP_nativeDEX.c

12
crypto777/bitcoind_RPC.c

@ -30,6 +30,7 @@ void *LP_alloc(uint64_t len);
void LP_free(void *ptr); void LP_free(void *ptr);
char *LP_clonestr(char *str);*/ char *LP_clonestr(char *str);*/
int32_t bitcoind_RPC_inittime;
#if LIQUIDITY_PROVIDER #if LIQUIDITY_PROVIDER
#include <curl/curl.h> #include <curl/curl.h>
@ -190,7 +191,16 @@ try_again:
curl_easy_setopt(curl_handle,CURLOPT_NOSIGNAL, 1L); // supposed to fix "Alarm clock" and long jump crash curl_easy_setopt(curl_handle,CURLOPT_NOSIGNAL, 1L); // supposed to fix "Alarm clock" and long jump crash
curl_easy_setopt(curl_handle,CURLOPT_NOPROGRESS, 1L); // no progress callback curl_easy_setopt(curl_handle,CURLOPT_NOPROGRESS, 1L); // no progress callback
if ( timeout > 0 ) if ( timeout > 0 )
curl_easy_setopt(curl_handle,CURLOPT_TIMEOUT, timeout); // causes problems with iguana timeouts {
if ( bitcoind_RPC_inittime != 0 )
{
#ifndef _WIN32
curl_easy_setopt(curl_handle,CURLOPT_TIMEOUT,1);
#else
curl_easy_setopt(curl_handle, CURLOPT_TIMEOUT_MS, timeout*100);
#endif
} else curl_easy_setopt(curl_handle,CURLOPT_TIMEOUT,timeout); // causes problems with iguana timeouts
}
if ( strncmp(url,"https",5) == 0 ) if ( strncmp(url,"https",5) == 0 )
{ {
curl_easy_setopt(curl_handle,CURLOPT_SSL_VERIFYPEER,0); curl_easy_setopt(curl_handle,CURLOPT_SSL_VERIFYPEER,0);

2
iguana/exchanges/LP_coins.c

@ -230,13 +230,11 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif)
jaddnum(item,"height",LP_getheight(&notarized,coin)); jaddnum(item,"height",LP_getheight(&notarized,coin));
if ( notarized > 0 ) if ( notarized > 0 )
jaddnum(item,"notarized",notarized); jaddnum(item,"notarized",notarized);
#ifndef _WIN32
if ( coin->electrum != 0 ) if ( coin->electrum != 0 )
balance = LP_unspents_load(coin->symbol,coin->smartaddr); balance = LP_unspents_load(coin->symbol,coin->smartaddr);
else balance = LP_RTsmartbalance(coin); else balance = LP_RTsmartbalance(coin);
jaddnum(item,"balance",dstr(balance)); jaddnum(item,"balance",dstr(balance));
jaddnum(item,"KMDvalue",dstr(LP_KMDvalue(coin,balance))); jaddnum(item,"KMDvalue",dstr(LP_KMDvalue(coin,balance)));
#endif
} }
else else
{ {

5
iguana/exchanges/LP_nativeDEX.c

@ -17,6 +17,7 @@
// LP_nativeDEX.c // LP_nativeDEX.c
// marketmaker // marketmaker
// //
// command_rpcloop elapsed 11369.68 millis > threshold 1000.00, ave 34.99 millis, count.645639 broadcast
// compress packets // compress packets
// https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki for signing BCH/BTG // https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki for signing BCH/BTG
// portfolio to set prices from historical // portfolio to set prices from historical
@ -1002,10 +1003,13 @@ int32_t LP_reserved_msg(int32_t priority,char *base,char *rel,bits256 pubkey,cha
return(n); return(n);
} }
extern int32_t bitcoind_RPC_inittime;
void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybusport,char *passphrase,int32_t amclient,char *userhome,cJSON *argjson) void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybusport,char *passphrase,int32_t amclient,char *userhome,cJSON *argjson)
{ {
char *myipaddr=0,version[64]; long filesize,n; int32_t valid,timeout,pubsock=-1; struct LP_peerinfo *mypeer=0; char pushaddr[128],subaddr[128],bindaddr[128],*coins_str=0; cJSON *coinsjson=0; void *ctx = bitcoin_ctx(); char *myipaddr=0,version[64]; long filesize,n; int32_t valid,timeout,pubsock=-1; struct LP_peerinfo *mypeer=0; char pushaddr[128],subaddr[128],bindaddr[128],*coins_str=0; cJSON *coinsjson=0; void *ctx = bitcoin_ctx();
sprintf(version,"Marketmaker %s.%s %s rsize.%ld",LP_MAJOR_VERSION,LP_MINOR_VERSION,LP_BUILD_NUMBER,sizeof(struct basilisk_request)); sprintf(version,"Marketmaker %s.%s %s rsize.%ld",LP_MAJOR_VERSION,LP_MINOR_VERSION,LP_BUILD_NUMBER,sizeof(struct basilisk_request));
bitcoind_RPC_inittime = 1;
printf("%s %u\n",version,calc_crc32(0,version,(int32_t)strlen(version))); printf("%s %u\n",version,calc_crc32(0,version,(int32_t)strlen(version)));
if ( LP_MAXPRICEINFOS > 256 ) if ( LP_MAXPRICEINFOS > 256 )
{ {
@ -1234,6 +1238,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu
} }
int32_t nonz; int32_t nonz;
LP_statslog_parse(); LP_statslog_parse();
bitcoind_RPC_inittime = 0;
while ( 1 ) while ( 1 )
{ {
nonz = 0; nonz = 0;

Loading…
Cancel
Save